-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-image.sh
36 lines (30 loc) · 941 Bytes
/
deploy-image.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
#!/usr/bin/env bash
set -e
ORG=djunoltd
REPO=install
NAMESPACE=$ORG/$REPO
TAG=${TRAVIS_BRANCH/\//-}
if [ $TRAVIS_PULL_REQUEST == "false" ]
then
if [ $TAG == "master" ]
then
TAG=$DJUNO_VERSION
else
TAG=$TAG-$DJUNO_VERSION
fi
else
TAG="pr-$TRAVIS_PULL_REQUEST-$TAG-$DJUNO_VERSION"
fi
IMAGE=$NAMESPACE:$TAG
docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
docker buildx create --name multi
docker buildx use multi
docker buildx inspect --bootstrap
docker buildx build --build-arg tag=$DJUNO_VERSION --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t $IMAGE .
if [ $TRAVIS_SECURE_ENV_VARS == "true" ]
then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker buildx build --build-arg tag=$DJUNO_VERSION --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -t $IMAGE --push .
else
echo "images can be pushed only from base repo"
fi