-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (39 loc) · 1.29 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
language: bash
services: docker
env:
global:
- PROJECT=k8s-ops
- NAMESPACE=stackfeed
- PUSH_NAMESPACES=stackfeed
matrix:
- DFDIR=./aws FLAVOUR=aws
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 any version from .latests (if we are not releasing)
[ -n "$VERSION" ] || VERSION=$(cat .latests | cut -f1 -d' ')
script:
- |-
docker-build -v $VERSION -F aws -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