-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
49 lines (48 loc) · 2.68 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
sudo: required
services: docker
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker --version # for verification
language: generic
notifications:
slack:
rooms:
secure: x1Xxi30dKk26LUWSASi5SiQvlQtTqDW5zBnZNh6lV1fSG3octj23s4FwT/pJ/j2aqNlLUq1GtXC/jssCSeCtzEovAv4XXNAqUqFP0TUfWvOWuxmUGTechxgVH66TD8oAhEuXN+LG1Vgq75uCyTkn/IBFHqOZfWXzQSpSe6XLSvYc/PF4SfVUlMV8ODFcX0ONo5kNOScpxCYCoT0DnDyw+6GreE4OAhZYhsxRwS7mCKf4c75BFHsoMKVHaxQLl1IMNXOM81X6wwH420341XAmDJ5XeUp4I+6JxNKV20OJ0WqmgWEs94XYy7koY19LRDsZAHsE9OBae+L6/4uxAIGx8pPsuBrakO8bYT0vG3JIkQZQLbYthvNTK5WFR3xjn2ARec2wLGI1icO7hY8WaPkaU7DGququOIfG3VQPKqND8WbijoEWO9eyFLvL86nqNiHlbsfdunD5qwArn1Hb+MP+a9H3veyrzyKam6S26R8SqObFD8V3Rlvie/tjQUZtIb39tsy4goMBa91vo7WLTo/pbK9GMJzSrOYjZs+TeiUWCp9VFlAUKXM3IYn+7M31NToPD9E+RFIChmQmFIOBE4xlNxow6aQxLRr0r4ET7EhFja7dwGj/zwhuqgfz1mrIKoWzsxXBmz7rTTW5mAJNpPK1QISFDXctvPry2F9Y03dXOPU=
on_success: always
on_failure: always
jobs:
include:
- stage: build docker images
env:
- TAG=$(grep "ENV VERSION" Dockerfile | awk 'NF>1{print $NF}')
- BASE_X86=jfloff/alpine-python
- BASE_ARM=resin/raspberry-pi-alpine-python
script:
- echo $TAG
# x86 build
- docker build --build-arg BASE_IMAGE=$BASE_X86 -t sdelrio/claymore-exporter -f Dockerfile .
# prepare qemu for arm build
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# build arm image
- docker build --build-arg BASE_IMAGE=$BASE_ARM -t sdelrio/claymore-exporter-arm -f Dockerfile .
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker tag sdelrio/claymore-exporter sdelrio/claymore-exporter:$TAG
docker push sdelrio/claymore-exporter:$TAG
docker push sdelrio/claymore-exporter
docker tag sdelrio/claymore-exporter-arm sdelrio/claymore-exporter-arm:$TAG
docker push sdelrio/claymore-exporter-arm:$TAG
docker push sdelrio/claymore-exporter-arm
fi
- stage: test
script:
# test x86 image
- docker run --rm -ti --entrypoint python sdelrio/claymore-exporter --version
- docker run --rm -ti --entrypoint python sdelrio/claymore-exporter /usr/local/bin/claymore-exporter.py -h
# test arm image
# prepare qemu for arm build
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker run --rm -ti --entrypoint python sdelrio/claymore-exporter-arm --version
- docker run --rm -ti --entrypoint python sdelrio/claymore-exporter-arm /usr/local/bin/claymore-exporter.py -h