forked from aerogear/unifiedpush-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
35 lines (31 loc) · 1.04 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
language: go
go:
- 1.10.x
env:
global:
- OPERATOR_NAME=unifiedpush-operator
stages:
- test
- compile
- name: push
if: fork = false
jobs:
include:
- stage: test
script:
- cd ${HOME}/gopath/src/github.com/aerogear/${OPERATOR_NAME}
- make setup/travis test/unit
- stage: compile
script:
- make setup/travis
- operator-sdk build quay.io/aerogear/${OPERATOR_NAME}:$(git rev-parse --short ${TRAVIS_COMMIT})
- stage: push
script:
- export BRANCH=$(if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then echo ${TRAVIS_BRANCH}; else echo ${TRAVIS_PULL_REQUEST_BRANCH}; fi)
- export TAG=$(git rev-parse --short ${TRAVIS_COMMIT})
- docker login --password "${QUAY_PASSWORD}" --username "${QUAY_USERNAME}" quay.io
- make setup/travis
- operator-sdk build quay.io/aerogear/${OPERATOR_NAME}:${TAG}
- docker push quay.io/aerogear/${OPERATOR_NAME}:${TAG}
- docker tag quay.io/aerogear/${OPERATOR_NAME}:${TAG} quay.io/aerogear/${OPERATOR_NAME}:${BRANCH}
- docker push quay.io/aerogear/${OPERATOR_NAME}:${BRANCH}