forked from microservices-demo/microservices-demo
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
40 lines (39 loc) · 2.08 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
language: java
sudo: required
services:
- docker
jdk:
- oraclejdk8
script:
- "echo skip"
after_success:
- export GROUP=weaveworksdemos
- if [ -z "$DOCKER_PASS" ] ; then
echo "This is a build triggered by an external PR. Skipping docker push.";
exit 0;
fi;
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=${GROUP}/$(basename openapi); # build openapi testing image
- echo "Building ${REPO}:$TRAVIS_COMMIT";
- docker build -t ${REPO}:$TRAVIS_COMMIT ./openapi; DOCKER_EXIT=$(echo $?); if [[ "$DOCKER_EXIT" > 0 ]] ; then
echo "Docker build failed with exit code $DOCKER_EXIT";
exit 1;
fi;
- export DOCKER_PUSH=1;
- while [ "$DOCKER_PUSH" -gt 0 ] ; do
echo "Pushing $REPO:$TRAVIS_COMMIT";
docker push $REPO:$TRAVIS_COMMIT;
DOCKER_PUSH=$(echo $?);
if [[ "$DOCKER_PUSH" -gt 0 ]] ; then
echo "Docker push failed with exit code $DOCKER_PUSH";
fi;
done;
- if [ "$TRAVIS_BRANCH" == "master" ]; then docker tag $REPO:$TRAVIS_COMMIT $REPO:snapshot; echo "Pushing $REPO:snapshot"; docker push $REPO:snapshot; fi;
- if [ ! -z "$TRAVIS_TAG" ]; then docker tag $REPO:$TRAVIS_COMMIT $REPO:$TRAVIS_TAG; docker push $REPO:$TRAVIS_TAG; docker tag $REPO:$TRAVIS_COMMIT $REPO:latest; docker push $REPO:latest; fi;
notifications:
slack:
secure: dGdpvdFHTUtZf2P/hw3tNqy4vBhDJAiqtUVI2+PwCjtTM7Gt9l0SfyL6swLTBQfMD+JEAt4iyGIQTu87GzJDFXyIKqNGixWQ8ltJHJdTmKhwhoMm2yAs5xsiV4rsiLJxDljH3xP+z5kE7ZZ7SmmaernKHrpF18NlrS4asLq67Wmft31rwVTpfCp9SQvNLpX+uJ5r5OFBHIlhdQmB37C/PP4zrzTgXPEN+82bGVfhrZBViUm0c+p5DAYMCzFMYU9q65mKE97Vg95FVo4Y+QoyYZwsM4PYrLjwwkV5m/aMa3Cig8lJALxgZNgIUY6D6fduDkppkeX+DQSpVQN59TBfdbh8Mnb3z54PsGLhKgc1tcYcUQVV0wR4VDpAg+FPhgtPA/XF6d5yHW1Dez+BdoFEAatmAAmWYHga8A+QqyWIUjv5XGwKT9RigcWnLpYxZxaVNpusGgNl+kFOfn9rPyoK3daMzRlCpg0UNdq1xIwh1HFAJ7he7u+TnpsJ0H7xXESdgZDXn5WBWL0ukNevO/94H4CFeBg+wd1lyBYpMLfBToQ6sxKBYlDgkzLOLwZzlab8EADmo7HiHW1aneVXH1l+rh4m3aG26KxDQElmOhang2YgZroUfm/ysc7VNxVHvjQG18h+9LY9hugFGiI8v9FT8ARBas+4c7Mene+SyL51iOI=
on_success: change
on_failure: change
on_start: never
on_pull_requests: false