-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
35 lines (26 loc) · 877 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
tag=$(get_octopusvariable "Project.Duck.ServerTag")
echo "Stop duck-local."
systemctl is-active --quiet jenkins-local && systemctl stop jenkins-local
docker-compose down
if [ ! -d "data" ]; then
echo "Create data folder."
mkdir data
fi
docker-compose pull
docker-compose up -d
mv duck.json data/
mv duck-local.service /etc/systemd/system
mv duck.local /etc/nginx/sites-available
if [ ! -e "/etc/nginx/sites-enabled/duck.local" ]; then
echo "Create /etc/nginx/sites-enabled/duck.local."
ln -s /etc/nginx/sites-available/duck.local /etc/nginx/sites-enabled/duck.local
fi
echo "Start duck-local."
systemctl is-enabled --quiet duck-local || systemctl enable duck-local
systemctl start duck-local
echo "Reload systemctl daemon."
systemctl daemon-reload
echo "Restart nginx."
systemctl restart nginx
write_highlight "[duck.local](https://duck.local)"
exit 0