-
Notifications
You must be signed in to change notification settings - Fork 37
/
.travis.yml
64 lines (56 loc) · 1.94 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
55
56
57
58
59
60
61
62
63
64
dist: bionic
os: linux
language: shell
services:
- docker
env:
global:
- DOCKER_PLATFORMS="linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6"
git:
depth: 1
before_install:
# Registering file format recognizers since RUN command is used
- sudo docker run --privileged linuxkit/binfmt:v0.7
# Get scripts for building Docker images
- id=$(docker create moikot/docker-tools)
- docker cp $id:/scripts.sh /tmp/scripts.sh && docker rm -v $id
# Update docker to the latest version and enable BuildKit
- /tmp/scripts.sh update_docker
stages:
- name: build amd64
if: branch != master AND tag IS blank
- name: build and deploy master
if: branch = master AND tag IS blank
- name: build and deploy a version
if: tag =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
matrix:
include:
- stage: build amd64
script:
- >-
/tmp/scripts.sh build_images
${TRAVIS_REPO_SLUG} ${TRAVIS_COMMIT::6} linux/amd64 --file Dockerfile.travisci
- stage: build and deploy master
script:
- >-
echo "${DOCKER_PASSWORD}" |
docker login -u "${DOCKER_USERNAME}" --password-stdin
- >-
/tmp/scripts.sh build_images
${TRAVIS_REPO_SLUG} master ${DOCKER_PLATFORMS} --push --file Dockerfile.travisci
- stage: build and deploy a version
script:
- >-
echo "${DOCKER_PASSWORD}" |
docker login -u "${DOCKER_USERNAME}" --password-stdin
- >-
/tmp/scripts.sh build_images
${TRAVIS_REPO_SLUG} ${TRAVIS_TAG} ${DOCKER_PLATFORMS} --push --file Dockerfile.travisci
# Uploading the readme via the docker hub api is currently not supported
# See https://github.com/docker/hub-feedback/issues/1927
# - >-
# - /tmp/scripts.sh push_readme
# - ${TRAVIS_REPO_SLUG} README.md
# - ${DOCKER_USERNAME} ${DOCKER_PASSWORD}
notifications:
email: false