forked from bugy/script-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_docker.sh
More file actions
executable file
·35 lines (26 loc) · 844 Bytes
/
Copy pathdeploy_docker.sh
File metadata and controls
executable file
·35 lines (26 loc) · 844 Bytes
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
#!/usr/bin/env bash
set -e
if [ -z "$DOCKER_USER" ] || [ -z "$DOCKER_PASSWORD" ] || [ -z "$TRAVIS_BRANCH" ]; then
echo 'Some environment variables are not set'
exit -1
fi
IMAGE_NAME='bugy/script-server'
unzip -o build/script-server.zip -d build/script-server
if [ "$TRAVIS_BRANCH" == "stable" ]; then
DOCKER_TAG='latest'
elif [ "$TRAVIS_BRANCH" == "master" ]; then
DOCKER_TAG='dev'
else
DOCKER_TAG="$TRAVIS_BRANCH"
fi
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
ADDITIONAL_TAG_ARG=""
if [ ! -z "$NEW_GIT_TAG" ]; then
ADDITIONAL_TAG_ARG="-t $IMAGE_NAME:$NEW_GIT_TAG"
fi
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 --push -f tools/Dockerfile \
-t "$IMAGE_NAME":"$DOCKER_TAG" \
$ADDITIONAL_TAG_ARG \
.