aboutsummaryrefslogtreecommitdiff
path: root/.scripts.d/40-publish.sh
diff options
context:
space:
mode:
Diffstat (limited to '.scripts.d/40-publish.sh')
-rw-r--r--.scripts.d/40-publish.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/.scripts.d/40-publish.sh b/.scripts.d/40-publish.sh
new file mode 100644
index 0000000..3e425c3
--- /dev/null
+++ b/.scripts.d/40-publish.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# vim: ai:ts=8:sw=8:noet
+set -EeufCo pipefail
+export SHELLOPTS # propagate set to children by default
+IFS=$'\t\n'
+
+# check required commands are in place
+command -v docker >/dev/null 2>&1 || {
+ echo 'please install docker-client'
+ exit 1
+}
+
+docker login --username "chn2guevara" \
+ --password-stdin <<<"$DOCKERHUB_TOKEN"
+
+docker run --privileged --rm tonistiigi/binfmt --install arm64
+docker buildx create --use --name multi-arch-builder
+
+DOCKER_TAG="latest"
+if [ "$GIT_BRANCH" != "master" ]; then
+ DOCKER_TAG="${GIT_BRANCH//\//-}"
+fi
+
+docker buildx build \
+ --platform linux/amd64,linux/arm64 \
+ --no-cache \
+ --pull \
+ --push \
+ --tag "chn2guevara/languagetool:${DOCKER_TAG}" \
+ .