-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (37 loc) · 943 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
dist: trusty
language: minimal
sudo: false
env:
global:
- fast_finish: true
- DOCKER_NAMESPACE=lansible
- CONTAINER_NAME=git-clone
services:
- docker
script:
# Try to pull tag but when empty pull branch_name
# If successful use as build cache
- |
docker pull "${DOCKER_NAMESPACE}/${CONTAINER_NAME}:${TRAVIS_TAG:-${TRAVIS_BRANCH}}"
if [[ $? ]]
then
CACHE="--cache-from ${DOCKER_NAMESPACE}/${CONTAINER_NAME}:${TRAVIS_BRANCH}"
fi
echo "CACHE is ${CACHE}"
- |
BUILD_TAGS="-t ${DOCKER_NAMESPACE}/${CONTAINER_NAME}:${TRAVIS_BRANCH}"
if [[ ${TRAVIS_TAG} != "" ]]
then
BUILD_TAGS+=" -t ${DOCKER_NAMESPACE}/${CONTAINER_NAME}:latest"
fi
echo "BUILD_TAGS are ${BUILD_TAGS}"
- docker build . ${CACHE} ${BUILD_TAGS}
deploy:
provider: script
script: bash deploy/deploy.sh
on:
all_branches: true
notifications:
email:
on_failure: change
on_success: never