-
Notifications
You must be signed in to change notification settings - Fork 53
/
.travis.yml
64 lines (52 loc) · 1.87 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
57
58
59
60
61
62
63
language: go
go: 1.11.5
env:
global:
- ETCD_VER=v3.3.0
- GO111MODULE=on
- DOCKER_LATEST=latest
matrix:
exclude:
go: 1.11.5
setup_etcd: &setup_etcd
before_script:
- curl -L https://github.com/coreos/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
- mkdir -p /tmp/etcd
- tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd --strip-components=1
- /tmp/etcd/etcd --advertise-client-urls http://127.0.0.1:12379 --listen-client-urls http://127.0.0.1:12379 > /dev/null &
build_docker_image: &build_docker_image
before_script:
- |
docker-compose build dev_weaver
[ ! -z $TRAVIS_TAG ] && docker tag weaver_dev_weaver:$DOCKER_LATEST gojektech/weaver:$TRAVIS_TAG
[ ! -z $TRAVIS_TAG ] && docker tag gojektech/weaver:$TRAVIS_TAG gojektech/weaver:$DOCKER_LATEST
[ ! -z $DOCKER_PASSWORD ] && echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker images
services:
- docker
stages:
- test
- name: deploy
if: (repo == gojektech/weaver) AND (branch == master) AND (tag IS present)
# travis is stupid to do its own custom install and script things
# This is the only way to skip them from running
install: echo "Skip global installing..."
script: echo "Skip global script..."
jobs:
include:
- stage: test
- name: "Make Spec"
<<: *setup_etcd
script: make test
- name: "Docker Spec"
<<: *build_docker_image
script: make docker-spec
after_script: make docker-clean
- stage: deploy
- name: "Release Builds"
script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist --skip-validate
- name: "Docker Builds"
<<: *build_docker_image
script: docker push gojektech/weaver:$TRAVIS_TAG && docker push gojektech/weaver:$DOCKER_LATEST
notifications:
email: false