forked from grafana/grafana-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
33 lines (28 loc) · 910 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
language: go
sudo: required
go:
- 1.13.x
env:
global:
- OPERATOR_NAME=grafana-operator
stages:
- test
- compile
- name: push
if: fork = false
jobs:
include:
- stage: test
script:
- make setup/travis code/check test/unit
- stage: compile
script:
- make setup/travis image/build TAG=$(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 image/build/push TAG=$TAG
- docker tag quay.io/ucloud/$OPERATOR_NAME:$TAG quay.io/ucloud/$OPERATOR_NAME:$BRANCH
- docker push quay.io/ucloud/$OPERATOR_NAME:$BRANCH