-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
33 lines (28 loc) · 836 Bytes
/
deploy.sh
File metadata and controls
33 lines (28 loc) · 836 Bytes
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
#!/bin/bash
echo "BUILDING NEW BIMATRI CONTAINER............."
docker build -t bima-tri .
if [ $? -ne 0 ]; then
echo "Failed to build Docker image"
exit 1
fi
echo "STOPPING EXISTING BIMATRI CONTAINER............."
docker container stop bima-tri
if [ $? -eq 0 ]; then
echo "Container stopped successfully"
else
echo "No running container named bima-tri, skipping stop step"
fi
echo "REMOVING EXISTING BIMATRI CONTAINER............."
docker container rm bima-tri
if [ $? -eq 0 ]; then
echo "Container removed successfully"
else
echo "No container named bima-tri, skipping remove step"
fi
echo "RUNNING NEW BIMATRI CONTAINER............."
docker run --restart always -d -p 8787:8787 --name bima-tri bima-tri
if [ $? -ne 0 ]; then
echo "Failed to run new Docker container"
exit 1
fi
echo "ALL IS DONE!"