-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (44 loc) · 1.93 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
sudo: required
language: c
services:
- docker
before_install:
- sudo apt-get update
- sudo apt-get install -qy docker-engine
- wget https://github.com/grammarly/rocker/releases/download/1.3.0/rocker_linux_amd64.tar.gz -O /tmp/rocker.tar.gz
- sudo tar -xvzf /tmp/rocker.tar.gz -C /usr/local/bin && sudo chmod +x /usr/local/bin/rocker
- sudo mkdir -m 777 -p /build/amd64 /build/arm
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
- 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
skip_cleanup: true
api-key:
secure: $GITHUB_TOKEN
file: /build/dnsdock.amd64
on:
tags: true
- provider: releases
skip_cleanup: true
api-key:
secure: $GITHUB_TOKEN
file: /build/dnsdock.arm
on:
tags: true
- provider: script
script: /tmp/deploy_containers.sh
on:
tags: true