-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
54 lines (50 loc) · 3.13 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
50
51
52
53
54
sudo: true
language: bash
services:
- docker
env:
global:
- DEBIAN_FRONTEND="noninteractive"
- DOCKERHUB_LIVE="taisun/port-forward"
- GITHUB_REPO="Taisun-Docker/port-forward"
jobs:
include:
- stage: BuildMaster
if: (branch = master) AND (NOT (type IN (pull_request)))
before_install:
- /bin/bash pre_install
script:
# Grab the qemu binaries
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-aarch64-static
- wget https://s3-us-west-2.amazonaws.com/taisun-builds/qemu/qemu-arm-static
- chmod +x qemu-*
# Build the applicaiton against the 3 architectures
- docker build --no-cache -f Dockerfile.amd64 -t ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} .
- docker build --no-cache -f Dockerfile.armhf -t ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} .
- docker build --no-cache -f Dockerfile.aarch64 -t ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} .
# Tag these builds to latest
- docker tag ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-latest
- docker tag ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-latest
- docker tag ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-latest
# Login to DockerHub
- echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
# Push all of the tags
- docker push ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT}
- docker push ${DOCKERHUB_LIVE}:amd64-latest
- docker push ${DOCKERHUB_LIVE}:arm32v6-latest
- docker push ${DOCKERHUB_LIVE}:arm64v8-latest
# Generate local manifests for latest and at commit
- docker manifest create ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:amd64-latest ${DOCKERHUB_LIVE}:arm32v6-latest ${DOCKERHUB_LIVE}:arm64v8-latest
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm32v6-latest --os linux --arch arm
- docker manifest annotate ${DOCKERHUB_LIVE}:latest ${DOCKERHUB_LIVE}:arm64v8-latest --os linux --arch arm64 --variant v8
- docker manifest create ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:amd64-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT}
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm32v6-${TRAVIS_COMMIT} --os linux --arch arm
- docker manifest annotate ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT} ${DOCKERHUB_LIVE}:arm64v8-${TRAVIS_COMMIT} --os linux --arch arm64 --variant v8
# Push the manifests to these meta tags
- docker manifest push ${DOCKERHUB_LIVE}:latest
- docker manifest push ${DOCKERHUB_LIVE}:${TRAVIS_COMMIT}
# Sync readme to DockerHub
- docker pull lsiodev/readme-sync
- docker run --rm=true -e DOCKERHUB_USERNAME=$DOCKERUSER -e DOCKERHUB_PASSWORD=$DOCKERPASS -e GIT_REPOSITORY=${GITHUB_REPO} -e DOCKER_REPOSITORY=${DOCKERHUB_LIVE} -e GIT_BRANCH=master lsiodev/readme-sync bash -c 'node sync'