You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thumbsup/scripts/travis-release-docker

21 lines
705 B
Bash

#!/bin/bash -e
if [ -z "${TRAVIS_TAG}" ]; then
echo "This script releases a Docker image corresponding to the npm package version"
echo "It should only be run on Travis CI for tagged commits"
exit 1
fi
# Build the image
DOCKER_IMAGE="thumbsupgallery/thumbsup"
PACKAGE_VERSION="${TRAVIS_TAG//v}"
docker build -f Dockerfile.release -t "${DOCKER_IMAGE}:${PACKAGE_VERSION}" --build-arg "PACKAGE_VERSION=${PACKAGE_VERSION}" .
# Pushes both <thumbsup:x.y.z> and <thumbsup:latest>
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker tag "${DOCKER_IMAGE}:${PACKAGE_VERSION}" "${DOCKER_IMAGE}:latest"
docker push "${DOCKER_IMAGE}:${PACKAGE_VERSION}"
docker push "${DOCKER_IMAGE}:latest"