forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
92 lines (82 loc) · 2.9 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
language: go
go_import_path: github.com/operator-framework/operator-sdk
sudo: required
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 go builds
- &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
# 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: skip
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
# Test markdown
- stage: test
name: Markdown Link Checker
language: bash
script: make test/markdown
after_success: echo 'Markdown links are correct'
after_failure: echo 'Incorrect markdown link detected'
# 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