Subversion Repositories oidplus

Rev

Rev 1436 | 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 - 2023 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. echo "==============================="
  19. echo "PREPARE FOR NEW OIDPLUS VERSION"
  20. echo "==============================="
  21. echo ""
  22.  
  23. # Please make sure to do all these steps before committing ANYTHING:
  24.  
  25. DIR=$( dirname "$0" )
  26.  
  27. # 0. Search for SPONGE (Marker invented by Terry A Davis)
  28. echo "0. Checking for forgotten sponges"
  29. grep -r "SPONGE" | grep -v "\.svn/pristine" | grep -v "dev/release.sh"
  30. if [ $? -eq 0 ]; then
  31.         echo "STOP! There are missing files. Please fix this problem (remove them from the SVN)"
  32.         exit 1
  33. fi
  34.  
  35. # 1. Recommended: Run dev/vendor_update.sh and make sure new/deleted files are added/deleted from the SVN/Git working copy
  36. echo "1. Run composer vendor update? (Recommended to do regularly)"
  37. select yn in "Yes" "No"; do
  38.     case $yn in
  39.         Yes ) "$DIR"/vendor_update.sh; break;;
  40.         No ) break;;
  41.     esac
  42. done
  43.  
  44. # 2. Make sure there are no unversioned files (otherwise systemfile check will generate wrong stuff)
  45. # PLEASE MAKE SURE that the SVN/Git-Working copy has no unversioned files, otherwise they would be included in the checksum catalog
  46. echo "2. Checking unversioned files"
  47. if [ -d "$DIR"/../.svn ]; then
  48.         cd "$DIR"/.. && svn stat | grep "^?"
  49.         if [ $? -eq 0 ]; then
  50.                 echo "STOP! There are unversioned files. Please add or remove them. (Otherwise systemfile check plugin will add these files)"
  51.                 exit 1
  52.         fi
  53.         cd "$DIR"/.. && svn stat | grep "^!"
  54.         if [ $? -eq 0 ]; then
  55.                 echo "STOP! There are missing files. Please fix this problem (remove them from the SVN)"
  56.                 exit 1
  57.         fi
  58. fi
  59. if [ -d "$DIR"/../.git ]; then
  60.         cd "$DIR"/.. && git status
  61.         echo "Is everything OK? (All files committed, no unversioned stuff? Otherwise system file check plugin will not work correctly)"
  62.         select yn in "Yes" "No"; do
  63.             case $yn in
  64.                 Yes ) break;;
  65.                 No ) echo "Please fix the issue first"; exit 1;;
  66.             esac
  67.         done
  68. fi
  69.  
  70. # 3. Run dev/translation/message_regenerate.phps and translate things which are missing in plugins/viathinksoft/language/dede/messages.xml (search for "TODO")
  71. echo "3. Checking translation..."
  72. while true; do
  73.         "$DIR"/translation/message_regenerate.phps
  74.         cat "$DIR"/../plugins/viathinksoft/language/dede/messages.xml | grep TODO > /dev/null
  75.         if [ $? -eq 0 ]; then
  76.                 echo "Problem: There are untranslated strings! Please translate them."
  77.                 sleep 2
  78.                 nano "$DIR"/../plugins/viathinksoft/language/dede/messages.xml
  79.         else
  80.                 break
  81.         fi
  82. done
  83.  
  84. # 4. Run dev/logger/verify_maskcodes.phps
  85. echo "4. Verify OIDplus Logger Maskcodes..."
  86. "$DIR"/logger/verify_maskcodes.phps
  87. if [ $? -ne 0 ]; then
  88.         echo "Please fix the issues and run release script again"
  89.         exit 1
  90. fi
  91.  
  92. # 5. Run phpstan
  93. echo "5. Running PHPSTAN..."
  94. cd "$DIR"/.. && phpstan
  95. echo "Is PHPSTAN output OK?"
  96. select yn in "Yes" "No"; do
  97.     case $yn in
  98.         Yes ) break;;
  99.         No ) echo "Please fix the issues and run release script again"; exit 1;;
  100.     esac
  101. done
  102.  
  103. # 6. Only if you want to start a new release: Add new entry to the top of changelog.json.php
  104. echo "6. Please edit changelog.json.php (add '-dev' for non-stable versions)"
  105. sleep 2
  106. while true; do
  107.     nano "$DIR"/../changelog.json.php
  108.     echo '<?php if (!@json_decode(@file_get_contents("'$DIR'/../changelog.json.php"))) exit(1);' | php
  109.     if [ $? -eq 0 ]; then
  110.         break
  111.     else
  112.         echo "JSON Syntax error! Please fix it"
  113.         sleep 2
  114.     fi
  115. done
  116.  
  117. # 7. Run plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
  118. echo "7. Generate system file check checksum file..."
  119. "$DIR"/../plugins/viathinksoft/adminPages/902_systemfile_check/private/gen_serverside_v3
  120.  
  121. # 8. Commit to SVN or GIT
  122. if [ -d "$DIR"/../.svn ]; then
  123.         echo "8. Committing to SVN"
  124.         svn commit
  125. elif [ -d "$DIR"/../.git ]; then
  126.         echo "8. ALL GOOD! PLEASE NOW COMMIT TO GIT"
  127. else
  128.         echo "8. ALL GOOD! YOU CAN RELEASE IT"
  129. fi
  130. exit 0
  131.  
  132. # 9. (ViaThinkSoft internal / runs automatically) Sync SVN to GitHub
  133.  
  134. # 10. (ViaThinkSoft internal / runs automatically) Run plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_git
  135. #                                                  or  plugins/viathinksoft/adminPages/900_software_update/private/gen_serverside_svn
  136. #                                                  depending wheather you want to use GIT or SVN as your development base
  137. #                                                  (Repos are read from includes/edition.ini)
  138.