-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
30 lines (30 loc) · 1.42 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
dist: bionic
language: shell
before_install:
- set -e
# Configure environment so changes are picked up when the Docker daemon is restarted after upgrading
- echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
- export DOCKER_CLI_EXPERIMENTAL=enabled
- docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
# Upgrade to Docker CE 19.03 for BuildKit support
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce=5:19.03.8~3-0~ubuntu-bionic # pin version for reproducibility
# Create Builder
- docker buildx create --name builder --use
stages:
- name: test
if: branch != master
- name: deploy
if: branch = master
jobs:
include:
- stage: test
script: docker buildx build --progress plain --build-arg VERSION=$VERSION --platform=linux/arm/v7 .
- stage: deploy
script:
- echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin &> /dev/null
- docker buildx build --progress plain --output type=docker --build-arg VERSION=$VERSION --platform=linux/arm/v7 -t $TRAVIS_REPO_SLUG:$VERSION .
- docker tag $TRAVIS_REPO_SLUG:$VERSION $TRAVIS_REPO_SLUG:latest
- docker push $TRAVIS_REPO_SLUG