forked from operator-framework/community-operators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (34 loc) · 2.09 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
dist: xenial
language: python
os: linux
sudo: required
if: branch = master
python:
- "3.6"
env:
- CHANGE_MINIKUBE_NONE_USER=true DISTRO_TYPE=upstream
before_install:
# check-pr needs to be sourced so it can pass the test early.
- source scripts/ci/check-pr $DISTRO_TYPE
install:
- scripts/ci/install-deps $DISTRO_TYPE
before_script:
- eval $(scripts/ci/operators-env) && scripts/ci/verify-operator
- sudo minikube start --memory=4096 --vm-driver=none --kubernetes-version="v1.17.0" --extra-config=apiserver.v=4
- sudo chown -R $USER ${HOME}/.{mini,}kube
- kubectl config use-context minikube
jobs:
include:
- name: Scorecard on minikube
script:
# Since travis conditionals can't operate on bash scripts, the first script
# line will check whether only scripts have been updated, and if so use
# the ripsaw operator as an operator to test script correctness.
- |-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q '\.yaml'; then \
OPERATORS_UPSTREAM="upstream-community-operators/ripsaw:$(yq r --tojson upstream-community-operators/ripsaw/ripsaw.package.yaml "channels" \
| jq ".[] | .currentCSV" | sort -V | tail -1 | sed -E 's/"[a-zA-Z\-]+\.?v?([0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?)"/\1/')" \
docker run -v ${HOME}/.kube/config:/root/.kube/config -v ${HOME}/.minikube:${HOME}/.minikube -v ${PWD}/community-operators:/community-operators -v ${PWD}/upstream-community-operators:/upstream-community-operators quay.io/operator-framework/operator-testing operator.test --no-print-directory OP_PATH="/upstream-community-operators/ripsaw" CLEAN_MODE=NORMAL INSTALL_MODE='' VERBOSE=1
fi
- docker pull quay.io/operator-framework/operator-testing
- eval $(scripts/ci/operators-env) && echo "${OP_PATH}" && docker run -v ${HOME}/.kube/config:/root/.kube/config -v ${HOME}/.minikube:${HOME}/.minikube -v ${PWD}/community-operators:/community-operators -v ${PWD}/upstream-community-operators:/upstream-community-operators quay.io/operator-framework/operator-testing operator.test --no-print-directory OP_PATH="${OP_PATH}" CLEAN_MODE=NORMAL INSTALL_MODE='' VERBOSE=1