fixes publishing Docker images in CI

This commit is contained in:
Julien Neuhart
2018-12-10 16:36:34 +01:00
parent 06e7a1fda1
commit c9f0d3bfd8
2 changed files with 14 additions and 4 deletions

View File

@@ -20,4 +20,4 @@ jobs:
script: make lint
- stage: publish
if: tag IS present
script: make image VERSION=$TRAVIS_TAG && ./scripts/publish.sh $TRAVIS_TAG $DOCKER_USER $DOCKER_PASS
script: ./scripts/publish.sh $TRAVIS_TAG $DOCKER_USER $DOCKER_PASS

View File

@@ -2,6 +2,7 @@
set -e
GOLANG_VERSION=1.11.2
VERSION="$1"
DOCKER_USER="$2"
DOCKER_PASSWORD="$3"
@@ -16,6 +17,15 @@ if [ $VERSION_LENGTH -ne 3 ]; then
exit 1
fi
docker push thecodingmachine/gotenberg:${SEMVER[0]}
docker push thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}
docker push thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}.${SEMVER[2]}
docker build -t thecodingmachine/gotenberg:base -f build/base/Dockerfile .
docker build \
--build-arg GOLANG_VERSION=${GOLANG_VERSION} \
--build-arg VERSION=${VERSION} \
-t thecodingmachine/gotenberg:${SEMVER[0]} \
-t thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]} \
-t thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}.${SEMVER[2]} \
-f build/package/Dockerfile .
docker push "thecodingmachine/gotenberg:${SEMVER[0]}"
docker push "thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}"
docker push "thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}.${SEMVER[2]}"