Subversion Repositories oidplus

Rev

Rev 827 | Rev 874 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/bin/bash
  2.  
  3. # OIDplus 2.0
  4. # Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. #     http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17.  
  18. DIR=$( dirname "$0" )
  19.  
  20. cd "$DIR/.."
  21.  
  22. # We temporarily move the .svn directory, otherwise
  23. # we cannot checkout fileformats and vnag in the vendor
  24. # directory
  25. if [ -d ".svn" ]; then
  26.         mv .svn _svn
  27. fi
  28.  
  29. # Remove vendor and composer.lock, so we can download everything again
  30. # (We need to receive everything again, because we had to delete the .git
  31. # .svn files and therefore we cannot do a simple "svn update" delta update anymore)
  32. rm -rf vendor
  33. rm composer.lock
  34.  
  35. # Download everything again
  36. composer update
  37.  
  38. # Remove stuff we don't want to publish or PHP files which could be
  39. # executed (which would be a security risk, because the vendor/ directory
  40. # can be accessed via the web-browser)
  41. remove_vendor_rubbish() {
  42.         shopt -s globstar
  43.         rm -rf $1vendor/**/.svn
  44.         rm -rf $1vendor/**/.git
  45.         rm -rf $1vendor/**/.gitignore
  46.         rm -rf $1vendor/**/.gitattributes
  47.         rm -rf $1vendor/**/.github
  48.         rm -rf $1vendor/**/demo
  49.         rm -rf $1vendor/**/demos
  50.         rm -rf $1vendor/twbs/bootstrap/package*
  51.         rm -rf $1vendor/twbs/bootstrap/*.js
  52.         rm -rf $1vendor/twbs/bootstrap/*.yml
  53.         rm -rf $1vendor/twbs/bootstrap/.* 2>/dev/null
  54.         rm -rf $1vendor/twbs/bootstrap/nuget/
  55.         rm -rf $1vendor/twbs/bootstrap/scss/
  56.         rm -rf $1vendor/twbs/bootstrap/js/
  57.         rm -rf $1vendor/twbs/bootstrap/build/
  58.         rm -rf $1vendor/twbs/bootstrap/site/
  59.         rm -rf $1vendor/google/recaptcha/examples/
  60.         rm -rf $1vendor/**/tests
  61.         rm -rf $1vendor/**/test
  62.         rm $1vendor/**/*.phpt
  63.         rm $1vendor/**/example.php
  64.         rm -rf $1vendor/danielmarschall/vnag/logos
  65.         rm -rf $1vendor/danielmarschall/vnag/doc
  66.         rm -rf $1vendor/danielmarschall/vnag/plugins
  67.         rm -rf $1vendor/danielmarschall/uuid_mac_utils/*.php
  68.         rm -rf $1vendor/danielmarschall/uuid_mac_utils/*.sh
  69.         rm -rf $1vendor/danielmarschall/uuid_mac_utils/*.css
  70.         rm -rf $1vendor/paragonie/random_compat/other
  71. }
  72. remove_vendor_rubbish ./
  73.  
  74. # It is important that symlinks are not existing, otherwise the .tar.gz dir
  75. # cannot be correctly extracted in Windows
  76. rm -rf vendor/bin
  77. rm -rf vendor/matthiasmullie/minify/bin
  78.  
  79. # Remove docker stuff since it might confuse services like synk
  80. rm vendor/matthiasmullie/minify/Dockerfile
  81. rm vendor/matthiasmullie/minify/docker-compose.yml
  82.  
  83. # Enable SVN again
  84. if [ -d "_svn" ]; then
  85.         mv _svn .svn
  86. fi
  87.  
  88. composer license > vendor/licenses
  89.  
  90. # -------
  91. # Update composer dependencies of plugins
  92. # -------
  93.  
  94. composer update -d plugins/viathinksoft/publicPages/100_whois/whois/xml/
  95. composer license -d plugins/viathinksoft/publicPages/100_whois/whois/xml/ > plugins/viathinksoft/publicPages/100_whois/whois/xml/vendor/licenses
  96. remove_vendor_rubbish plugins/viathinksoft/publicPages/100_whois/whois/xml/
  97.  
  98. composer update -d plugins/viathinksoft/publicPages/100_whois/whois/json/
  99. composer license -d plugins/viathinksoft/publicPages/100_whois/whois/json/ > plugins/viathinksoft/publicPages/100_whois/whois/json/vendor/licenses
  100. remove_vendor_rubbish plugins/viathinksoft/publicPages/100_whois/whois/json/
  101.