-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
55 lines (52 loc) · 2.74 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
sudo: required
services:
- docker
language: bash
jobs:
include:
- stage: Build & Push RevPi Docker Image
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export TAG=`if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then echo "latest"; elif [ $TRAVIS_PULL_REQUEST == "true" ]; then echo $TRAVIS_PULL_REQUEST_BRANCH; else echo $TRAVIS_BUILD_NUMBER; fi`
- export REPO=sthuber90/revpi
- cd revpi-docker
- chmod +x repo/usr/bin/piSerial
- chmod +x repo/usr/bin/qemu-arm-static
- chmod +x repo/usr/bin/revpi-config
- chmod +x repo/usr/sbin/revpi-factory-reset
- chmod +x repo/opt/vc/bin/vcgencmd
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build -t $REPO:$TAG .
- if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then
docker tag $REPO:$TAG $REPO:$TRAVIS_BUILD_NUMBER;
docker push $REPO:$TRAVIS_BUILD_NUMBER;
fi
- docker push $REPO:$TAG
- stage: Build & Push Flavoured Images
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export TAG=`if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then echo "latest"; elif [ $TRAVIS_PULL_REQUEST == "true" ]; then echo $TRAVIS_PULL_REQUEST_BRANCH; else echo $TRAVIS_BUILD_NUMBER; fi`
- export REPO=sthuber90/revpi-node
- cd revpi-node
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build -t $REPO:$TAG .
- if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then
docker tag $REPO:$TAG $REPO:$TRAVIS_BUILD_NUMBER;
docker push $REPO:$TRAVIS_BUILD_NUMBER;
fi
- docker push $REPO:$TAG
- script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export TAG=`if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then echo "latest"; elif [ $TRAVIS_PULL_REQUEST == "true" ]; then echo $TRAVIS_PULL_REQUEST_BRANCH; else echo $TRAVIS_BUILD_NUMBER; fi`
- export REPO=sthuber90/revpi-python
- cd revpi-python
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build -t $REPO:$TAG .
- if [[ $TRAVIS_PULL_REQUEST == "false" ]] && [[ $TRAVIS_BRANCH == "master" ]]; then
docker tag $REPO:$TAG $REPO:$TRAVIS_BUILD_NUMBER;
docker push $REPO:$TRAVIS_BUILD_NUMBER;
fi
- docker push $REPO:$TAG