This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (37 loc) · 2.3 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
language: bash
services: docker
sudo: required
notifications:
slack:
email: false
rooms:
- secure: KYnSm6QnVZit06xZA8++6z3xeX8pYeoNIFkDh0aU0LaZGDJ5+CtgnmAzoBMi3Kn523s1jSbGIXY95VTTdr88pVJXzYIFKRPQku8U7Iq80wden/frtjZBUt97bPghlEO73MOIl/hWOAWi0jRKS/h0aGf3iWbyEm8x4VVbta2JRnTSGClXw0Db8UZ+i6VdTMGc59tNPOsEe0wDDY+p1NFEEnLf2lz51tW2SIeoxSK9jq2kDKQwUmHRxyl6ConyJFbCTOhqVw8boq5X5HSPHQpBmtAJNqYJZtR/9rfORJs7ARVBlIWM0qKHwWuLzxhZof4TiFoCshln94OdMtK4Vvu99B0PF7W/mAsBzAYT2d4un1my5Z8fkMgx2eg4g4D1N4fKqViqx/iJnV6J3U6u0SBP3/c0CITpT1lsO9bhgbr1Tr0us3ARE94MPBude2j2yWh9EnnhPQowLC9utv89uvQFyHSy8esBStFElHH6lKKhzTOwsB5ewL4Lk0ziZlUb9amXJDWrB2FHTTYiyoXE4lMLA3HzEYrQKms9heGyqeaUhOWfeLg1iKUzCMKWvOgof7cfY9lsFk1nZqsJJyPDOwq9hmrsH3QGAUyBmn5y57DyfPnDtMaHAkJaqIuLegYGUaNad4x2sxw73hjyXA9Y4USvWj8GPM4u8fyMxZg+KtCJkLw=
on_success: change
env:
- IMAGE=prometheus
- IMAGE=node_exporter
- IMAGE=alertmanager
- IMAGE=blackbox_exporter
install:
- docker run --rm --privileged multiarch/qemu-user-static:register
script:
# Download
- git clone https://github.com/prometheus/${IMAGE}
- curl -L -o qemu-arm-static.tar.gz https://github.com/multiarch/qemu-user-static/releases/download/v2.6.0/qemu-arm-static.tar.gz && tar zx -f qemu-arm-static.tar.gz -C ${IMAGE}
- DOWNLOAD_URL=$(curl -s https://api.github.com/repos/prometheus/${IMAGE}/releases/latest | grep "browser_download_url" | grep "linux-armv7" | cut -d\" -f4)
- curl -L -o ${IMAGE}.tar.gz ${DOWNLOAD_URL} && tar zx -f ${IMAGE}.tar.gz --strip-components=1 -C ${IMAGE}
# Build
- patch ${IMAGE}/Dockerfile Dockerfile.${IMAGE}.patch
- docker build -t napnap75/rpi-prometheus:${IMAGE} ${IMAGE}
# Check
- docker images
- OPTIONS=$(if [ "$IMAGE" == "alertmanager" ]; then echo "-mesh.peer-id=test" ; fi)
- docker run --rm napnap75/rpi-prometheus:${IMAGE} --version ${OPTIONS}
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ;
docker push napnap75/rpi-prometheus:${IMAGE} ;
VERSION=$(docker run --rm napnap75/rpi-prometheus:${IMAGE} --version ${OPTIONS} 2>&1 | grep "${IMAGE}, version" | egrep -o "[0-9]+\.[0-9]+\.[0-9]+") ;
docker tag napnap75/rpi-prometheus:${IMAGE} napnap75/rpi-prometheus:${IMAGE}-${VERSION} ;
docker push napnap75/rpi-prometheus:${IMAGE}-${VERSION} ;
fi