diff --git a/.travis.yml b/.travis.yml index a5980708..05db359c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 \ No newline at end of file + script: ./scripts/publish.sh $TRAVIS_TAG $DOCKER_USER $DOCKER_PASS \ No newline at end of file diff --git a/scripts/publish.sh b/scripts/publish.sh index f544fb25..5898fb77 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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]} \ No newline at end of file +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]}" \ No newline at end of file