tools: add delpoy script for clouddot

This will be invoked by the cloud.redhat.com infrastructure to deploy
composer containers to quay.io.
This commit is contained in:
Tom Gundersen 2020-12-21 18:02:35 +01:00 committed by Sanne Raymaekers
parent c3185466ae
commit 73deee0f43

18
tools/clouddot_build_deploy.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# AppSRE runs this script to build the container and push it to Quay.
set -exv
IMAGE_NAME="quay.io/cloudservices/osbuild-composer"
IMAGE_TAG=$(git rev-parse --short=7 HEAD)
if [[ -z "$QUAY_USER" || -z "$QUAY_TOKEN" ]]; then
echo "QUAY_USER and QUAY_TOKEN must be set"
exit 1
fi
DOCKER_CONF="$PWD/.docker"
mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" build -f distribution/Dockerfile-ubi -t "${IMAGE_NAME}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE_NAME}:${IMAGE_TAG}"