-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprod.sh
More file actions
executable file
·69 lines (59 loc) · 1.32 KB
/
prod.sh
File metadata and controls
executable file
·69 lines (59 loc) · 1.32 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
helpFunction()
{
echo ""
echo "usage: $0 <action>"
echo ""
echo "actions: build | mount | load | up | down"
echo ""
echo "additional required parameters:"
echo "- for mount: user@ip"
echo "- for load: filepath"
exit 1
}
action=$1
wd="$(pwd)"
# validate options
if [ -z "$action" ]; then
echo "missing action parameter"
helpFunction
fi
if [ "$action" == "build" ]; then
cd kebapp_server
docker build -f Dockerfile.production -t kebapp-server . --platform linux/arm64
cd ..
fi
if [ "$action" == "mount" ]; then
host=$2
if [ -z "$host" ]; then
echo "missing host parameter"
helpFunction
fi
cd kebapp_server
docker save -o "$wd/kebapp-server.tar" kebapp-server
scp "$wd/kebapp-server.tar" $host:~/kebapp-server.tar
rm "$wd/kebapp-server.tar"
cd ..
fi
if [ "$action" == "load" ]; then
file=$2
if [ -z "$file" ]; then
echo "missing file parameter"
helpFunction
fi
docker load -i "$file"
fi
if [ "$action" == "up" ]; then
cd kebapp_server
docker compose -f docker-compose.production.yaml up -d
sleep 1
docker compose -f docker-compose.production.yaml ps
cd ..
fi
if [ "$action" == "down" ]; then
cd kebapp_server
docker compose -f docker-compose.production.yaml down
sleep 1
docker compose -f docker-compose.production.yaml ps
cd ..
fi