forked from stolostron/multicloud-operators-placementrule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (79 loc) · 3.26 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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: "rn5yfUBpR6kOlnYbwcnWQNgUPKwboU0MLb4oxPaqb6El00I439KFuFIdl2QsBH/f8Js0O4a3iX9P6R+vHJoPpiCynKFgnHfTWCyHMD+L1gsuf5irVmyoHOK8x8UjkiTH8Djxz06qJKbEEZaiFYXBwHwrGUApJ4kD/6Jpd/S3mcDZ9fJkr9HqC+xtiWTfLBQToj4qkP3rDZGslGR6RXRyHaJ/h/mr6mm7ogOPIgKTjxn8/9jybe1rteP4pX9vXwdiCKQXUYyttGT8dlBFfmpMJ973qLpPPR3vApWxSDGqUoC5zg7PMYW+ThM9ihcb70PFeFVZyPTE4qdSoOKjWrEa2KNeasYp9U8lmhja7ZrfpYqp1BBJLEljezteEk4w5snLlcVE/dd1iBxmRGA3yKFqW4vUYUk8Sxma/lsPVgYgf9L5hWz8B1oUkAwDkAe+miUTA9JTLHXpmy3/kZkx6cQ6MBGR9ANXI/ifrgf3OC43+Icittl5p/wShhKEZ2BlIc4vxBgV+a8uRe8qy1BxhHj9WB0wB7m+uB+XS0lTQkKVOxX4dWyZxpJTkimRueewSVSG06UjQF/vV9UniE8Jb9pWj69ZAPpFFCr+AUmqxMmHd9b9/Emr7TWGtBuP7rkdRSqLBJcq1p4730+PfdgbwtX2C2Wu2iqUkiDJvvPKTC2HD08="
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
make build-latest-community-operator
- stage: unit-test
name: "Run unit test"
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}
make release-community-operator