-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·31 lines (25 loc) · 1.03 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
#!/usr/bin/env bash
echo "--- Building vampire-squid (reminder: run docker login first!!)"
BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
VCS_REF=`git tag | sort -V | tail -1`
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "Working directory is $SCRIPT_DIR"
cd $SCRIPT_DIR
sbt stage
ARCH=$(uname -m)
if [[ $ARCH == 'arm64' ]]; then
# https://betterprogramming.pub/how-to-actually-deploy-docker-images-built-on-a-m1-macs-with-apple-silicon-a35e39318e97
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t mbari/vampire-squid:${VCS_REF} \
-t mbari/vampire-squid:latest \
--push . && \
docker pull mbari/vampire-squid:${VCS_REF}
else
docker build --build-arg BUILD_DATE=$BUILD_DATE \
--build-arg VCS_REF=$VCS_REF \
-t mbari/vampire-squid:${VCS_REF} \
-t mbari/vampire-squid:latest . && \
docker push mbari/vampire-squid
fi
# docker buildx build --platform linux/arm64 -t mbari/vampire-squid:latest --load .