File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
server/apps/distributed-app Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # To add this script as a cronjob,run 'crontab -e' and add the following line with the appropriate paths
4
+ # @reboot /path/to/directory/start_docker_compose.sh /path/to/directory >> /path/to/save/log/cronlog.log 2>&1
5
+
6
+ if [ $# -ne 1 ]; then
7
+ echo " Usage: $0 <directory>"
8
+ exit 1
9
+ fi
10
+
11
+ TARGET_DIR=" $1 "
12
+
13
+ cd " $TARGET_DIR " || exit
14
+
15
+ while ! systemctl is-active --quiet docker; do
16
+ sleep 1
17
+ done
18
+
19
+ /usr/bin/docker compose -f docker-composeOLD.yml down
20
+ /usr/bin/docker compose -f docker-composeOLD.yml up -d
21
+
22
+ check_health () {
23
+ while true ; do
24
+ response=$( curl -s -o /dev/null -w " %{http_code}" http://localhost:8000/healthcheck)
25
+ if [[ " $response " -eq 200 ]]; then
26
+ echo " Health check passed: Received 200 response."
27
+ break
28
+ else
29
+ echo " Health check failed: Received $response response. Retrying..."
30
+ sleep 5
31
+ fi
32
+ done
33
+ }
34
+
35
+ check_health
36
+
37
+ /usr/bin/docker exec james james-cli AddDomain cloud.appscode.com
38
+ /usr/bin/docker
exec james james-cli AddUser
[email protected] password
You can’t perform that action at this time.
0 commit comments