From 657074234d2bb8c1e75acfe37499c163ff30a57d Mon Sep 17 00:00:00 2001 From: Alexandre ACEBEDO Date: Sat, 26 Nov 2016 16:13:16 +0100 Subject: [PATCH] Fixing travis docker push --- .travis.yml | 14 ++++++++------ Rockerfile | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index eafae11..d45db6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_install: script: - if git describe --contains ${TRAVIS_COMMIT} &>/dev/null; then export VERSIONARGS="-var DOCKERIMAGE_VERSION=`git describe --contains ${TRAVIS_COMMIT}`"; else unset VERSIONARGS; fi + - if git describe --contains ${TRAVIS_COMMIT} &>/dev/null; then export VERSION="`git describe --contains ${TRAVIS_COMMIT}`"; else unset VERSION; fi - rocker build --no-cache ${VERSIONARGS} -var GIT_COMMIT=${TRAVIS_COMMIT} -var OUTPUT_DIR=/build/amd64 -var ARCH=amd64 . - rocker build --no-cache ${VERSIONARGS} -var GIT_COMMIT=${TRAVIS_COMMIT} -var OUTPUT_DIR=/build/arm -var ARCH=arm . @@ -20,7 +21,12 @@ after_success: - sudo mv /build/amd64/dnsdock /build/dnsdock.amd64 - sudo mv /build/arm/dnsdock /build/dnsdock.arm - sudo chmod -R a+rw /build - - sudo chmod a+rx ./deploy_containers.sh + - echo "docker login -u $DOCKER_USER -p $DOCKER_PASSWORD" >> /tmp/deploy_containers.sh + - echo "docker push aacebedo/dnsdock:latest-amd64" >> /tmp/deploy_containers.sh + - echo "docker push aacebedo/dnsdock:latest-arm" >> /tmp/deploy_containers.sh + - echo "docker push aacebedo/dnsdock:$VERSION-amd64" >> /tmp/deploy_containers.sh + - echo "docker push aacebedo/dnsdock:$VERSION-arm" >> /tmp/deploy_containers.sh + - sudo chmod a+rx /tmp/deploy_containers.sh deploy: - provider: releases @@ -38,10 +44,6 @@ deploy: on: tags: true - provider: script - script: rocker build --auth $DOCKER_USER:$DOCKER_PASSWORD --push -var GIT_COMMIT=${TRAVIS_COMMIT} ${VERSIONARGS} -var ARCH=amd64 . - on: - tags: true - - provider: script - script: rocker build --auth $DOCKER_USER:$DOCKER_PASSWORD --push -var GIT_COMMIT=${TRAVIS_COMMIT} ${VERSIONARGS} -var ARCH=arm . + script: /tmp/deploy_containers.sh on: tags: true \ No newline at end of file diff --git a/Rockerfile b/Rockerfile index 126f2ed..90cb9a7 100644 --- a/Rockerfile +++ b/Rockerfile @@ -78,9 +78,7 @@ FROM easypi/alpine-arm IMPORT ./dnsdock /bin/dnsdock ENTRYPOINT ["dnsdock"] TAG aacebedo/dnsdock:{{$DOCKERIMAGE_VERSION}}-{{$ARCH}} -PUSH aacebedo/dnsdock:{{$DOCKERIMAGE_VERSION}}-{{$ARCH}} {{if ne $DOCKERIMAGE_VERSION "dev"}} TAG aacebedo/dnsdock:latest-{{$ARCH}} -PUSH aacebedo/dnsdock:latest-{{$ARCH}} {{end}}