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