forked from kuanf/multicloud-operators-subscription
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yaml
87 lines (79 loc) · 2.97 KB
/
.travis.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
os:
- linux
language: go
go:
- "1.13"
services:
- docker
branches:
only:
- master
- dev
- /^[0-9]+\..*$/
- /^v[0-9]+\..*$/
- /^release-[0-9]+\..*$/
#addons:
# sonarcloud:
# organization: "open-cluster-management"
# token:
# secure: "DfEGb8eJmJJBLz8XH7R4clXgJ5eQPFqy4GMxuPMsWc//7IKH0sj1K8ynJldyQUJhZOUiYrFch3gnh7Oi1+bJu9eN3j+dN080sxX2aVQAVQZ5sFheVVO17cIrRNznpHHoo+g0VwyXVAGdSlin0Zdge5XY2Go16z6LYCIH1dH2Dg1JTornVnJp1WhnQepmLKQhJd/yNRNttcK2facD6XtCJfyw68Di4jGs3Trs0zL/2uRaHthvP204HUk9qXEzsMoZPjmkRa0PM8y0FKjOx1O+dRNRgyjdLgXe1Ph+3PVb9Kr58iB4UIUpfABz3mGpj5Tkf8cStYcKPiJ49M7w7QERuBKd2rQySIDxhJU+kk5u1JyflsE10wvFForowtBIiYjrn2pGAYIprj/11AsIFnFlZ+D4iuobeD+Q+XXzT2o="
env:
global:
# Required
- OS=linux
# Component Specific
- COMPONENT_INIT_COMMAND=${TRAVIS_BUILD_DIR}/build/install-dependencies.sh
- COMPONENT_DEPLOY_COMMAND=${TRAVIS_BUILD_DIR}/build/deploy-to-cluster.sh
- COMPONENT_BUILD_COMMAND=${TRAVIS_BUILD_DIR}/build/build.sh
- COMPONENT_UNIT_TEST_COMMAND=${TRAVIS_BUILD_DIR}/build/run-unit-tests.sh
- COMPONENT_E2E_TEST_COMMAND=${TRAVIS_BUILD_DIR}/build/run-e2e-tests.sh
# define stages
stages:
- lint
- build
- unit-test
- test-e2e
- publish
jobs:
include:
- stage: lint
name: "Run code lint"
if: type = pull_request
script: bash ${TRAVIS_BUILD_DIR}/build/run-code-lint.sh
- stage: build
name: "Build the image and run unit tests"
script:
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export COMPONENT_TAG_EXTENSION="-PR${TRAVIS_PULL_REQUEST}-${TRAVIS_COMMIT}"; fi;
- |
make
make component/build
make component/push
- stage: unit-test
name: "Run unit test"
if: type = pull_request
script:
# Set the image tag differently for PRs
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export COMPONENT_TAG_EXTENSION="-PR${TRAVIS_PULL_REQUEST}-${TRAVIS_COMMIT}"; fi;
# Bootstrap the build harness, pull test image, and run unit tests.
- |
make
make component/test/unit
make sonar/go
- stage: test-e2e
name: "Deploy the image to a cluster and run e2e tests"
if: type = pull_request
script:
#Check out a clusterpool, set up oc, deploy, run e2e tests, and return clusterpool cluster
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export COMPONENT_TAG_EXTENSION="-PR${TRAVIS_PULL_REQUEST}-${TRAVIS_COMMIT}"; fi;
- |
make
make component/pull
make component/test/e2e
- stage: publish
name: "Publish the image to quay with an official version/sha tag and publish entry to integration pipeline stage"
if: type = push AND branch =~ /^release-[0-9]+\..*$/
script:
- |
make
make pipeline-manifest/update PIPELINE_MANIFEST_COMPONENT_SHA256=${TRAVIS_COMMIT} PIPELINE_MANIFEST_COMPONENT_REPO=${TRAVIS_REPO_SLUG} PIPELINE_MANIFEST_BRANCH=${TRAVIS_BRANCH}
© 2020 GitHub, Inc.