-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
48 lines (39 loc) · 1.23 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
language: bash
services: docker
env:
global:
- PROJECT=vw
- NAMESPACE=actionml
- PUSH_NAMESPACES=actionml
matrix:
- DFDIR=. FLAVOUR=harness
install:
- curl -sSL https://github.com/stackfeed/ci-scripts/raw/master/install.sh | sh -s -- -r v0.2
before_script:
- |-
export PATH=$PATH:~/ci-scripts
export LATESTS=$(curl -sSL "https://raw.githubusercontent.com/${TRAVIS_REPO_SLUG}/master/.latests")
export VERSION=$TRAVIS_TAG
# pick branch revision instead tag
[ -n "$VERSION" ] || VERSION=$TRAVIS_BRANCH
script:
- |-
docker-build -v $VERSION -f $FLAVOUR -l "$LATESTS" "$NAMESPACE/$PROJECT" \
--build-arg version=${VERSION} \
-f ${DFDIR}/Dockerfile ./ || exit $?
# deploy containers to hub.docker.com
after_deploy:
- |
# Skip if we are not in the push namespace list
( echo "$PUSH_NAMESPACES" | grep -qw "${TRAVIS_REPO_SLUG%/*}" ) || exit 0
docker-push -r "^$NAMESPACE/$PROJECT:?.*"
# update microbadger
curl -XPOST "https://hooks.microbadger.com/images/${NAMESPACE}/${PROJECT}/${MICROBADGER_TOKEN}"
deploy:
- provider: script
script: /bin/true
on:
tags: true
# condition: $TRAVIS_TAG =~ ^[0-9]
after_script:
- docker images