forked from connext/router-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_nxtp
More file actions
55 lines (39 loc) · 777 Bytes
/
deploy_nxtp
File metadata and controls
55 lines (39 loc) · 777 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
set -e
set -o pipefail
image="ghcr.io/connext/nxtp-router"
tag=$1
if [[ -z "$tag" ]]; then
echo "Empty tag name"
exit 1
fi
app_path="/home/connext/nxtp-router-docker-compose"
now=$(date +"%Y-%m-%d_%H-%M-%S-%p")
logfile="$app_path/logs/deploy_$now.log"
cd $app_path
mkdir -p logs
touch $logfile
{
echo "=== Date: $now"
echo ""
echo "=== Deploing now:"
echo "=== Image: $image"
echo "=== Tag: $tag"
echo ""
sed -i -e "s#.*ROUTER_VERSION=.*#ROUTER_VERSION=$tag#" .env
echo "=== Remove unused data"
docker system prune -f
docker system prune -af
echo ""
echo "=== Pull new image"
docker pull $image:$tag
echo ""
echo "=== Update containers"
docker-compose up -d
echo ""
sleep 5s
docker images
echo ""
docker ps -a
echo ""
} 2>&1 | tee -a "$logfile"