File tree Expand file tree Collapse file tree 3 files changed +117
-0
lines changed Expand file tree Collapse file tree 3 files changed +117
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
3+ DATE=$( date +%Y-%m-%d:%H:%M:%S)
4+ VERSION=" $( basename " ${DIR} " ) "
5+
6+ countly stop
7+ if [ -f " $DIR /upgrade_fs.sh" ]; then
8+ bash " $DIR /upgrade_fs.sh" combined 2>&1 | tee -a " $DIR /../../../log/countly-upgrade-fs-$VERSION -$DATE .log"
9+ fi
10+ if [ -f " $DIR /upgrade_db.sh" ]; then
11+ bash " $DIR /upgrade_db.sh" combined 2>&1 | tee -a " $DIR /../../../log/countly-upgrade-db-$VERSION -$DATE .log"
12+ fi
13+ countly upgrade
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ VER=" 25.06"
4+
5+ CONTINUE=" $( countly check before upgrade db " $VER " ) "
6+
7+ if [ " $CONTINUE " != " 1" ] && [ " $1 " != " combined" ]
8+ then
9+ echo " Database is already up to date with $VER "
10+ read -r -p " Are you sure you want to run this script? [y/N] " response
11+ if [[ " $response " =~ ^([yY][eE][sS]| [yY])$ ]]
12+ then
13+ CONTINUE=1
14+ fi
15+ fi
16+
17+ if [ " $CONTINUE " == " 1" ]
18+ then
19+ echo " Running database modifications"
20+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.." && pwd ) "
21+ SCRIPTS=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
22+
23+ if [ " $1 " != " combined" ]; then
24+ # upgrade plugins
25+ countly plugin enable content;
26+ countly plugin enable journey_engine;
27+ nodejs " $DIR /scripts/install_plugins.js"
28+ fi
29+
30+ # add indexes
31+ nodejs " $DIR /scripts/add_indexes.js"
32+
33+ # run upgrade scripts
34+ nodejs " $SCRIPTS /scripts/merge_events_collections.js"
35+
36+
37+ if [ " $1 " != " combined" ]; then
38+ countly upgrade;
39+ fi
40+
41+ # call after check
42+ countly check after upgrade db " $VER "
43+ elif [ " $CONTINUE " == " 0" ]
44+ then
45+ echo " Database is already upgraded to $VER "
46+ elif [ " $CONTINUE " == " -1" ]
47+ then
48+ echo " Database is upgraded to higher version"
49+ else
50+ echo " Unknown upgrade state: $CONTINUE "
51+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Running filesystem modifications"
4+
5+ VER=" 25.06"
6+
7+ CONTINUE=" $( countly check before upgrade fs " $VER " ) "
8+
9+ if [ " $CONTINUE " != " 1" ] && [ " $1 " != " combined" ]
10+ then
11+ echo " Filesystem is already up to date with $VER "
12+ read -r -p " Are you sure you want to run this script? [y/N] " response
13+ if [[ " $response " =~ ^([yY][eE][sS]| [yY])$ ]]
14+ then
15+ CONTINUE=1
16+ fi
17+ fi
18+
19+ if [ " $CONTINUE " == " 1" ]
20+ then
21+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.." && pwd ) "
22+
23+ # enable command line
24+ bash " $DIR /scripts/detect.init.sh"
25+ rm -rf " $DIR /../plugins/old-ui-compatibility"
26+
27+ countly plugin enable content;
28+ countly plugin enable journey_engine;
29+
30+ # upgrade plugins
31+ nodejs " $DIR /scripts/install_plugins.js"
32+
33+ # get web sdk
34+ countly update sdk-web
35+
36+
37+ if [ " $1 " != " combined" ]; then
38+ countly upgrade;
39+ else
40+ countly task dist-all;
41+ fi
42+
43+ # call after check
44+ countly check after upgrade fs " $VER "
45+ elif [ " $CONTINUE " == " 0" ]
46+ then
47+ echo " Filesystem is already upgraded to $VER "
48+ elif [ " $CONTINUE " == " -1" ]
49+ then
50+ echo " Filesystem is upgraded to higher version"
51+ else
52+ echo " Unknown upgrade state: $CONTINUE "
53+ fi
You can’t perform that action at this time.
0 commit comments