forked from hypriot/rpi-alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
28 lines (28 loc) · 908 Bytes
/
.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
sudo: required
services:
- docker
language: bash
script:
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# get qemu-arm-static binary
- mkdir tmp
- >
pushd tmp &&
curl -L -o qemu-arm-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v3.0.0/qemu-arm-static.tar.gz &&
tar xzf qemu-arm-static.tar.gz &&
popd
# build image
- docker build -t beckonconn/rpi-alpine:build .
# test image
- docker run beckonconn/rpi-alpine:build uname -a
# push image
- >
if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
TAG=$(grep "FROM " Dockerfile | sed 's/.*://')
docker tag beckonconn/rpi-alpine:build beckonconn/rpi-alpine:$TAG
docker tag beckonconn/rpi-alpine:build beckonconn/rpi-alpine:latest
docker push beckonconn/rpi-alpine:$TAG
docker push beckonconn/rpi-alpine:latest
fi