-
-
Notifications
You must be signed in to change notification settings - Fork 282
Expand file tree
/
Copy pathdeploy_docker.sh
More file actions
executable file
·33 lines (24 loc) · 884 Bytes
/
deploy_docker.sh
File metadata and controls
executable file
·33 lines (24 loc) · 884 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
#!/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"
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 --push -f tools/Dockerfile -t "$IMAGE_NAME":"$DOCKER_TAG" .
echo "NEW_GIT_TAG=$NEW_GIT_TAG"
if [ ! -z "$NEW_GIT_TAG" ]; then
docker tag "$IMAGE_NAME":"$DOCKER_TAG" "$IMAGE_NAME":"$NEW_GIT_TAG"
docker push "$IMAGE_NAME":"$NEW_GIT_TAG"
fi