-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.travis.yml
120 lines (107 loc) · 4.44 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
111
112
113
114
115
116
117
118
119
120
services: docker
sudo: required
dist: xenial
language: go
go:
- 1.13.x
env:
global:
- PATH=/opt/python/3.6.7/bin:$PATH
- GO111MODULE=on
- KUBE_VERSION="v1.16.2"
- OP_VER="v0.11.0"
- CSI_OP_VER="${TRAVIS_BRANCH}.${TRAVIS_OS_NAME}"
- QUAY_USERNAME="mew2057"
- DOCKER_REPO="quay.io/${QUAY_USERNAME}/ibm-spectrum-scale-csi-operator-test:${CSI_OP_VER}"
- LOCAL_IMAGE="csi.ibm.com/csi-scale-operator:testing"
- OPERATOR_SDK="https://github.com/operator-framework/operator-sdk/releases/download/${OP_VER}/operator-sdk-${OP_VER}-x86_64-linux-gnu"
- CSI_OP_BUILD_DIR="${TRAVIS_BUILD_DIR}/stable/ibm-spectrum-scale-csi-operator-bundle/operators/ibm-spectrum-scale-csi-operator"
- OPERATOR_NAME=ibm-spectrum-scale-csi-operator
- OLM_MANIFEST="${CSI_OP_BUILD_DIR}/deploy/olm-catalog/${OPERATOR_NAME}/"
- CHANGE_MINIKUBE_NONE_USER=true
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- KUBECONFIG=$HOME/.kube/config
addons:
apt:
packages:
- "python3"
- "python3-dev"
- "python3-pip"
stages:
- lint
- build
- test
jobs:
fast_finish: true
include:
# Install operator-courier and run the lint on the manifest.
- stage: precheck
name: "Precheck: Run linters and bundle automation."
script:
- pip install ansible
# Testing that the generated files match the deploy/*.yaml files, it they do not match, fail Travis
- ansible-playbook ${TRAVIS_BUILD_DIR}/ansible/generate-playbook.yaml --extra-vars "travis_testing=true"
- pip install operator-courier
- cd ${CSI_OP_BUILD_DIR}
- python hacks/package_operator.py -d ${OLM_MANIFEST} -o /tmp/operator --nozip
- operator-courier --verbose verify --ui_validate_io /tmp/operator
- stage: build
name: "Build: operator"
script:
- sudo pip install docker
- docker version
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- cd ${CSI_OP_BUILD_DIR}
- operator-sdk version
- go version
- operator-sdk build csi-scale-operator
- docker tag csi-scale-operator ${DOCKER_REPO}
#- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo "$QUAY_BOT_PASSWORD" | docker login -u "$QUAY_BOT_USERNAME" --password-stdin quay.io; docker push ${DOCKER_REPO}; fi'
- name: "Build: docs"
script:
- pip install sphinx sphinx_rtd_theme recommonmark
- cd ${TRAVIS_BUILD_DIR}/docs
- make html
# Install minikube, build the image and run the scorecard.
- stage: test
name: "Test: scorecard"
before_install:
- sudo pip install docker
- pip install openshift
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
- operator-sdk build csi-scale-operator
- docker tag csi-scale-operator ${DOCKER_REPO}
script:
# Print environment
# Build the image, clear and restore the finalizers.
- python hacks/clear_finalizers.py
- python hacks/change_deploy_image.py -i ${DOCKER_REPO} --ifnotpresent
- kubectl create -f deploy/namespace.yaml
- operator-sdk scorecard --config .osdk-scorecard.yaml
- python hacks/clear_finalizers.py --restore
- before_install:
- sudo pip install docker
- pip install pyyaml molecule openshift docker jmespath
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_minikube.sh
- ${TRAVIS_BUILD_DIR}/scripts/ci/install_operator-sdk.sh
- kubectl version
- cd ${CSI_OP_BUILD_DIR}
- eval $(minikube docker-env) # Popping this out, because I don't think the script is working.
- operator-sdk build csi-scale-operator
- docker tag csi-scale-operator ${LOCAL_IMAGE}
name: "Test: molecule"
script:
# This needs to be built before we can test with molecule for reasons.
- python hacks/change_deploy_image.py -i ${LOCAL_IMAGE} --ifnotpresent
- kubectl create -f deploy/namespace.yaml
- molecule test -s test-local
#- ${TRAVIS_BUILD_DIR}/scripts/ci/fold_ouput.sh cluster.info.2 "cluster information" kubectl cluster-info dump
notifications:
email:
- jdunham@us.ibm.com