forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
110 lines (98 loc) · 3.69 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: go
go_import_path: github.com/operator-framework/operator-sdk
sudo: required
cache:
directories:
- $HOME/.cache/go-build
go:
- 1.10.3
# The `x_base_steps` top-level key is unknown to travis,
# so we can use it to create a bunch of common build step
# YAML anchors which we use in our build jobs.
x_base_steps:
# before_install for jobs that require dep
- &dep_before_install
before_install:
- curl -Lo dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
- travis_retry dep ensure -v
# before_install for jobs that require go builds and do not run for doc-only changes
- &go_before_install
before_install:
# hack/ci/check-doc-only-update.sh needs to be sourced so
# that it can properly exit the test early with success
- source hack/ci/check-doc-only-update.sh
- curl -Lo dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
- travis_retry dep ensure -v
# Base go, ansbile, and helm job
- &test
stage: test
env: CLUSTER=openshift
<<: *go_before_install
install:
- make install
- hack/ci/setup-openshift.sh
after_success:
- echo "Build succeeded, operator was generated, memcached operator is running on $CLUSTER, and unit/integration tests pass"
after_failure:
- echo "Build failed, operator failed to generate, memcached operator is not running on $CLUSTER, or unit/integration tests failed"
- kubectl get all --all-namespaces
- kubectl get events --all-namespaces --field-selector=type=Warning
services:
- docker
# Base deploy job
- &deploy
stage: deploy
if: type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
<<: *go_before_install
install: make install
before_script:
- git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
- git fetch --unshallow --tags
after_success:
- echo "Image build succeeded, and docker image tagged and pushed to repository"
after_failure:
- echo "Image build, docker image tagging, or docker image pushing to repository failed"
services:
- docker
jobs:
include:
# Build and test go
- <<: *test
name: Go on OpenShift
script: make test/ci-go ARGS="-v"
# Build and test ansible
- <<: *test
name: Ansible on OpenShift
before_script: sudo pip install ansible
script: make test/ci-ansible
# Build and test helm
- <<: *test
name: Helm on OpenShift
script: make test/ci-helm
# Run the unit, sanity, and markdown tests
- stage: test
name: Unit, Sanity, and Markdown Tests
# Currently, prow/api-ci tests all PRs that target master; use travis for post merge testing and non-master PRs
if: type != pull_request OR branch != master
<<: *dep_before_install
script: make test/sanity test/unit test/markdown
after_success: echo 'Tests Passed'
after_failure: echo 'Failure in unit, sanity, or markdown test'
# Build and deploy ansible-operator docker image
- <<: *deploy
name: Docker image for ansible-operator
script:
- make image/build/ansible
- make image/push/ansible
# Build and deploy helm-operator docker image
- <<: *deploy
name: Docker image for helm-operator
script:
- make image/build/helm
- make image/push/helm
# Build and deploy scorecard-proxy docker image
- <<: *deploy
name: Docker image for scorecard-proxy
script:
- make image/build/scorecard-proxy
- make image/push/scorecard-proxy