-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (24 loc) · 952 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
language: python
services:
- docker
env:
global:
- IMAGE_VERSION=0.0.1
jobs:
include:
- stage: build docker image
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t $DOCKER_USERNAME/cryptocurrency_exporter .
- docker images
- docker push $DOCKER_USERNAME/cryptocurrency_exporter
- docker tag $DOCKER_USERNAME/cryptocurrency_exporter $DOCKER_USERNAME/cryptocurrency_exporter:${IMAGE_VERSION}
- docker push $DOCKER_USERNAME/cryptocurrency_exporter:${IMAGE_VERSION}
- stage: test
script:
- docker run --rm -p 0.0.0.0:9510:9510 $DOCKER_USERNAME/cryptocurrency_exporter --test
- stage: secondtest
script:
- docker run -d -p 0.0.0.0:9510:9510 $DOCKER_USERNAME/cryptocurrency_exporter --test
- for i in {1..30}; do curl -sw '%{http_code}' localhost:9510/metrics && if [ $? = 0 ]; then exit 0; fi; sleep 2 ; done