-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (46 loc) · 1.63 KB
/
build.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
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$MY_DIR"
BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
VCS_REF=`git tag | sort -V | tail -1`
# Github packages needs an access token. So move one into the docker context
cp "$HOME/.m2/settings.xml" "$MY_DIR/settings.xml"
# docker build --build-arg BUILD_DATE=$BUILD_DATE \
# --build-arg VCS_REF=$VCS_REF \
# -t mbari/charybdis:${VCS_REF} \
# -t mbari/charybdis:latest \
# -f Dockerfile . && \
# docker push mbari/charybdis
`docker buildx build \
--platform linux/amd64,linux/arm64 \
-t mbari/charybdis:${VCS_REF} \
-t mbari/charybdis:latest \
-f Dockerfile \
--push . `
rm "$MY_DIR/settings.xml"
ssh "[email protected]" << 'ENDSSH'
docker pull mbari/charybdis
docker stop charybdis
docker rm -f charybdis
docker run -d --name=charybdis \
-p 8300:8080 \
-e ANNOTATION_SERVICE_URL="http://ione.mbari.org:8100/anno/v1" \
-e ANNOTATION_SERVICE_TIMEOUT="PT20S" \
-e MEDIA_SERVICE_URL="http://ione.mbari.org:8200/vam/v1" \
-e MEDIA_SERVICE_TIMEOUT="PT10S" \
--restart unless-stopped \
mbari/charybdis
ENDSSH
ssh "[email protected]" << 'ENDSSH'
docker pull mbari/charybdis
docker stop charybdis
docker rm -f charybdis
docker run -d --name=charybdis \
-p 8300:8080 \
-e ANNOTATION_SERVICE_URL="http://m3.shore.mbari.org/anno/v1" \
-e ANNOTATION_SERVICE_TIMEOUT="PT20S" \
-e MEDIA_SERVICE_URL="http://m3.shore.mbari.org/vam/v1" \
-e MEDIA_SERVICE_TIMEOUT="PT10S" \
--restart unless-stopped \
mbari/charybdis
ENDSSH