forked from ESGF/esgf-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
54 lines (49 loc) · 1.96 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
sudo: required
services:
- docker
addons:
apt:
packages:
- docker-ce
branches:
only:
- master
script:
- |
export ESGF_VERSION="$(git describe --always --tags)"
# Define a bash function that just echos something every 60s
periodic_echo() {
while true; do
sleep 60
echo "Ensuring execution continues..."
done
}
# Start the build in the background
docker-compose build &
build_pid=$!
# Start the periodic echo in the background
periodic_echo &
echo_pid=$!
# Wait for the build to exit
wait $build_pid
# The final result should be the exit status of the build
build_status=$?
# Kill the echo
kill -9 $echo_pid
# If the build failed, exit now
[ "$build_status" -ne "0" ] && exit $build_status
# Only if the branch is master and not a pull request, push to Docker Hub
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
# Log in to Docker Hub
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
# Push with the git describe tag
docker-compose push
# Retag with latest and push
export ESGF_VERSION=latest
docker-compose build
docker-compose push
fi
notifications:
email: false
slack:
secure: b1x8LxhKWKHS+cID+9XkFm3JLwGPviTVnPu91L7K9asBEsjYssYFudS/LCSxHdwVC9lJomoKe0ojy8fKx10NAAKacCb7h2TmVh/niaum38f12VeObhm6IPxUz3kytzcbCPR6OIs5fackkDSTuztR2vT2LlLKphs5mlvIMqkUg0wOPNxbl6KN188YSR9ozHfqt4uALitvYNdhkk5NEDmLZOVS//1cwYYHmDGw2uX6xQUf/nudLx14H7ea7eb0y3CyeQeAg6a7rE2iMEbwxqS35B231WYFD5rEkLPIEz/9h9syQRcK6eLObymbu7Ol9kNHa3GcepgI1RYfDJ71rKjzna1Y0rmqxAlf4M7ZvUGhiwqSasY9xgeWFzNn5dp+PsxhryVRUzHZ9W3JLq6NcVFp1evqPOQx94AE5uXwA8WWF5o/65yi4lQQ2uqXeRlYkYsXot8TPowZWV3HZZdQP859az0bivXKGif+N6Q3Ls56zFwQWJbtRFmVq1vDpa7f4wQ/zZysjxmJsYWfyAXo3hfcY59IGFtddoC96NIVSAaozjlKWOjWpG9GPjSNjZHF+GMNNYb/lBw6rddx5NDpvEvCDl3uNiX3CDjR/vZTg3xNkSAX3Ps5HDg+i7rXJ0Y/fe0Lf9dfx3jRxOLsBWgjE8OyZelr+mcgmakPr/aEhaL/pSc=