-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.bash
executable file
·60 lines (53 loc) · 973 Bytes
/
deploy.bash
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
#!/usr/bin/env bash
set -e
image_name="ds9"
version=$(head -n 1 "VERSION")
push=""
latest=""
test=""
while [[ $# -gt 0 ]]; do
case $1 in
-i|--image-name)
image_name=$2
shift
shift
;;
-v|--version)
version=$2
shift
shift
;;
-p|--push)
push="yes"
shift
;;
-l|--latest)
latest="yes"
shift
;;
-t|--test)
test="yes"
shift
;;
esac
done
image_name="ghcr.io/klebert-engineering/$image_name"
docker build -t "$image_name:$version" .
if [[ -n "$latest" ]]; then
echo "Tagging latest."
docker tag "$image_name:$version" "$image_name:latest"
fi
if [[ -n "$push" ]]; then
echo "Pushing."
docker push "$image_name:$version"
if [[ -n "$latest" ]]; then
docker push "$image_name:latest"
fi
fi
if [[ -n "$test" ]]; then
echo "Running test."
docker run --rm -it \
-p 8091:8091 \
"$image_name:$version" \
"//ds9/serve.bash"
fi