Skip to content

Commit e1bb1b2

Browse files
authored
Update 40_docker.sh
1 parent ab99389 commit e1bb1b2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

scripts.d/40_docker.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,55 @@ sync; sync; sync
5757

5858
docker images
5959

60+
planetdir='tenalp'
61+
mkdir -p "$OLD/mnt/img_root/srv/$planetdir"
62+
cd "$OLD/mnt/img_root/srv/$planetdir"
63+
64+
# download Planet
65+
wget https://raw.githubusercontent.com/open-learning-exchange/planet/master/docker/planet.yml
66+
wget https://raw.githubusercontent.com/open-learning-exchange/planet/master/docker/install.yml
67+
wget https://raw.githubusercontent.com/open-learning-exchange/planet/master/docker/volumes.yml
68+
touch .chat.env
69+
70+
{
71+
echo "services:"
72+
echo " couchdb:"
73+
echo " volumes:"
74+
echo " - \"$OLD/mnt/img_root/srv/$planetdir/data:/opt/couchdb/data\""
75+
echo " - \"$OLD/mnt/img_root/srv/$planetdir/log:/opt/couchdb/var/log\""
76+
echo " planet:"
77+
echo " volumes:"
78+
echo " - \"$OLD/mnt/img_root/srv/$planetdir/pwd:/usr/share/nginx/html/credentials\""
79+
} > volumestravis.yml
80+
81+
sync; sync; sync
82+
83+
docker compose -f planet.yml -f volumestravis.yml -p planet up -d
84+
85+
# check if couch-db is working
86+
while ! curl -X GET http://127.0.0.1:2200/_all_dbs ; do
87+
sleep 5
88+
docker ps -a
89+
done
90+
echo "couch is up"
91+
92+
sync; sync; sync
93+
94+
docker ps -f name=planet_db-init* -a -q
95+
# check if couch-db docker has finish
96+
while [[ $(docker inspect -f '{{.State.Running}}' "$(docker ps -f name=planet_db-init* -a -q)") == "true" ]]; do
97+
sleep 1
98+
done
99+
echo "couch has finished"
100+
101+
tree -f "mnt/img_root/srv/$planetdir"
102+
103+
# sync and stop docker
104+
sync; sync; sync
105+
docker compose -f planet.yml -f volumestravis.yml -p planet stop
106+
107+
cd -
108+
60109
service docker stop
61110
unlink docker
62111
mv docker.temp docker

0 commit comments

Comments
 (0)