-
Notifications
You must be signed in to change notification settings - Fork 33
/
deploy.sh
47 lines (33 loc) · 1.05 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
#!/bin/bash
# --- deploying server ---
# cd packages/server
# ../../deploy.sh cesium-server $VERSION
# --- deploying client ---
# cd packages/client
# npm run build:prod
# ../../deploy.sh cesium/client $VERSION
target=$1
echo "target $target"
if [ -z "$target" ]
then
echo "Missing deployment target"
exit 1
fi
version=$2
echo "version $version"
if [ -z "$version" ]
then
echo "Missing deployment version"
exit 1
fi
echo "start deploying version $version on target $target"
eval $(aws ecr get-login --no-include-email --region eu-central-1)
docker build -t "$target:$version" .
docker tag "$target:$version" "$target:latest"
docker tag "$target:latest" "223455578796.dkr.ecr.eu-central-1.amazonaws.com/$target:latest"
docker tag "$target:latest" "223455578796.dkr.ecr.eu-central-1.amazonaws.com/$target:$version"
docker push "223455578796.dkr.ecr.eu-central-1.amazonaws.com/$target:latest"
docker push "223455578796.dkr.ecr.eu-central-1.amazonaws.com/$target:$version"
echo "deployment succeeded";
PAUSE
read -n1 -r -p "Press any key to continue..." key