Skip to content

Commit

Permalink
Fixing travis docker push
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebedo committed Nov 26, 2016
1 parent 083dbe6 commit 6570742
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ 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 .

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
Expand All @@ -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
2 changes: 0 additions & 2 deletions Rockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 6570742

Please sign in to comment.