-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
73 lines (66 loc) · 2.84 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
#
# Sample .travis.yml using the mvp-helloworld image (a helmoperator)
#
os:
- linux
language: python
python: "3.7"
services:
- docker
addons:
sonarcloud:
organization: "open-cluster-management"
token:
secure: "VlhgSso+hJhaJP/mQVOh8pqD/hcSrkyn187G3bZXKI2uF/dNY8zV1Opy0WJRiEoGJ8AXr9N7Hx6lkVxMcpSd6DNwL2SGc0Rshy/EVcG7jnGZVDo/lsKGrC9lZEWkT9t/ZCij68P9YncWObtvrjsPn2575/qM8yAI05hjAhpPdK80g0+qzqjCGW595i0mEygvTAmcLbRHPJQZ0MAIt0WNsWkEVfBlilgDnUNT5axbnbGNWexBr6JnuRPeSIN5cF1TEyQfZvlSzwQxZLQ4/fDHGez2MwFIY3otoV2J0NVr0SKSiFNbNcJo7aVx8oIB4HtSPCUgvB6TaociCa/uX9au6pPuwSX8vCOGY0OB+1M9m4L1VGHmc9O8yI6437aOCccTxYeorUz44SImzBv0lq5XNHHqHebnDyeYXyTjTnn9Uqly5pC+2DsXCx8yIez+htizu9AMHEpaxLJtom//Lmd+gwkLZhtY45dRkKr8e4cgZIgQpKaq6YrmSPyquuYTUBzPDAaLW4xtXwTktKOBMoTTGp1Q46mrL7vHcmrtR3a8DGpc7Hc4RSSZx0O3nAiUXYaZBdAtNo6NTAYF+uN2bWMxcan8akXvJ6PSF5HdLELsEB9aZEZ7rcIdeQ2BOov/+vjI9M1WFQsp6A4KRN9+NVil5wKlv2magn5TCkKTVVLuzk4="
env:
global:
# Required
- OS=linux
- COMPONENT_TAG_EXTENSION="-${TRAVIS_COMMIT}"
# Component Specific
- COMPONENT_DEPLOY_COMMAND=${TRAVIS_BUILD_DIR}/deploy-to-cluster.sh
- COMPONENT_TYPE="helmoperator"
stages:
- build
- unit-test
- test-e2e
- publish
jobs:
include:
- stage: build
name: "Build the test image and push it"
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 tests"
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/pull
make component/test/unit
sonar-scanner --debug
- 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}