-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
executable file
·56 lines (42 loc) · 1.02 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -eo pipefail
BELT_ENV_TOOLBOX_TOOLS="caddy"
source /dev/stdin <<< "$(curl -Lsm 2 https://get.belt.sh)"
install_caddy() {
echo -n "==> Installing caddy "
caddy_install
echo "OK"
}
deploy_app() {
echo -n "==> Uploading app archive "
app_upload "./belt-demo.tar.gz"
echo "OK"
echo -n "==> Stopping process "
systemd_unit_stop "belt-demo" "ignore errors"
echo "OK"
echo -n "==> Setting up user "
user_add "belt-demo"
echo "OK"
echo -n "==> Copying files "
app_copy_file "belt-demo-app"
app_copy_file ".env"
echo "OK"
echo -n "==> Setting up permissions "
app_set_permissions "belt-demo:belt-demo"
echo "OK"
echo -n "==> Copying unit file "
systemd_add_unit "belt-demo.service"
echo "OK"
echo -n "==> Starting process "
systemd_unit_start "belt-demo"
echo "OK"
echo -n "==> Adding caddy vhost "
caddy_add_vhost
echo "OK"
echo -n "==> Restarting caddy "
caddy_restart
echo "OK"
}
belt_begin_session "root" "belt-demo.tomb.io"
install_caddy
deploy_app