-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
56 lines (44 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
sudo: required
services:
- docker
cache:
timeout: 1000
directories:
- $HOME/.cache
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
- du -ch $HOME/.cache
before_install:
- docker ps
- docker info
# Start the Elasticsearch service
- docker pull commonsearch/local-elasticsearch
- ./scripts/git-set-file-times
# Load Docker cache if any
# Please note: There is a different cache for each build matrix worker, depending on the env.
# Hopefully this can be removed soon. See: https://github.com/docker/docker/issues/20316
- mkdir -p $HOME/.cache/docker/
- if [ -f $HOME/.cache/docker/image.tgz ]; then
echo "Docker cache found, loading..." &&
sh -c "gunzip -c $HOME/.cache/docker/image.tgz | docker load" &&
docker history commonsearch/local-back;
fi
- export CACHED_DOCKER_HASH=`docker history -q commonsearch/local-back | head -n1`
# Rebuild the image, possibly using the cache
- make docker_build
- docker history commonsearch/local-back
- export NEW_DOCKER_HASH=`docker history -q commonsearch/local-back | head -n1`
- 'echo "Cached Docker hash: $CACHED_DOCKER_HASH vs. New Docker hash: $NEW_DOCKER_HASH"'
# If the cache hash changed, save the docker image in the cache
- if [ "$NEW_DOCKER_HASH" != "$CACHED_DOCKER_HASH" ]; then
echo "Updating cache" &&
rm -rf $HOME/.cache/docker/* &&
sh -c "docker save commonsearch/local-back $(docker history -q commonsearch/local-back | tail -n +2 | grep -v \<missing\> | tr '\n' ' ') | gzip > $HOME/.cache/docker/image.tgz";
fi
script:
- make docker_pylint
- make docker_test_coverage
notifications:
slack:
rooms:
secure: OSFinow7BnCBhkon/FTtvMFKObNpqvSBPpqiL11UeRi3nykcL8uGItfoqoOmAvdZTgVIuunmAn1xKdyqMnewdoXh4mBcp46jBq/r77m1kbq4o3gMFbWyrTfDPwQzkdlLaaIRtZHuxrAX9110OfROaLMDVkTmyxukBUgG3fwwEyHmMbujjOKomCO12L7pokC80V03nmPKOt76Nu49kVwr2khxeccgVTX8/Sk1NO+l3KwN5DCLXS/v+PFF+8woo88v4UnIDgZ40zLyWas/Rvs6La3+m47pDOCIKnSQWXecJ7WwfMZONXmYDs6GfCWf516kPLlh87VgzS8K/oZ5gpCHO6yXfex5TspD5Lh0Wxjez3Xo1xJvN14c0N2xLxLykzcGxc2cx8tEhqL8C3ptYqykP7/FYExuuvMO3hC6eScNAeRyyw1fO5HPWK4bijkgOdajbBAGXrdii8h/CcgaKq+PMsSbR8kQAjRShvy/rtZ0PJGDGGIGLcOfpLOlS2yhnvhOhSeKI5fGxof2YV/GF/9qMPMF9aB9rkbfKy9e2yNX2TqrH7CD/O9jcijb/wPJe5mVvOp70lm2QZ9NIr407ale/kf5gKxuoQbjFdByihJrZcs9dh958k8l5gd0fk/XpehKH76LWvQtBNfZzi9Q/oBYnnrp+SF0ltOnDIULcwNkpww=