forked from jupyterhub/zero-to-jupyterhub-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
149 lines (130 loc) · 6.11 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
os: linux
dist: bionic
language: python
python:
- 3.7
git:
## depth set to false overrides travis default behavior to use shallow clones
## with depth 50 that can cause issues
##
## ref: https://github.com/jupyterhub/chartpress#shallow-clones
##
depth: false
services:
- docker
stages:
- name: test
- name: publish
if: tag IS present OR ( branch IN (master) AND type IN (push) )
before_install:
# Exit immediately if a command exits with a non-zero status.
- set -e
- . ci/common
- pip install "docker~=4.2.0"
# The default install script below will prepare a k8s cluster to work with, but
# not install JupyterHub itself, as upgrade tests may want to make multiple
# installations in sequence etc.
install:
# Fix to avoid rebuilding images already built
- remove_docker_mirror_on_travis
# Setup our k3s based Kubernetes cluster and use its kubectl as well
- setup_k3s
- setup_helm
- helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
- helm repo update
# Install a local ACME server
- helm install pebble jupyterhub/pebble --values dev-config-pebble.yaml
# Build our images if needed and update values.yaml with the tags
- pip3 install --no-cache-dir -r dev-requirements.txt
- chartpress
# Pre-install JupyterHub
- await_dns # part of k3s, jupyterhub needs it while referencing https://pebble/dir
- await_calico # installed with setup_k3s, enforces netpol
- await_pebble # jupyterhub's autohttps communicates with it as the ACME server
script:
# Install JupyterHub
- helm install jupyterhub ./jupyterhub --values dev-config.yaml
- await_jupyterhub
- await_autohttps_tls_cert_acquisition
# Run tests
- pytest --verbose --exitfirst ./tests
env:
# Global environment variables will act as defaults, jobs will override them
global:
- K3S_VERSION=v1.18.4+k3s1
- HELM_VERSION=v3.2.4
jobs:
## don't wait for the jobs that are allowed to fail to report success
##
## ref: https://docs.travis-ci.com/user/customizing-the-build/#rows-that-are-allowed-to-fail
## ref: https://docs.travis-ci.com/user/customizing-the-build/#fast-finishing
##
allow_failures:
- name: docs:link-check
fast_finish: true
## define individual jobs that can rely on defaults from above
## k3s versions: https://github.com/rancher/k3s/releases
## helm versions: https://github.com/helm/helm/releases
include:
- stage: test
name: chart:k8s-1.18
- stage: test
name: chart:k8s-1.17
env: K3S_VERSION=v1.17.7+k3s1
- stage: test
name: chart:k8s-1.16
env: K3S_VERSION=v1.16.11+k3s1 k3s_disable_command=--no-deploy
- stage: test
name: chart:install-latest-then-upgrade
script:
## NOTE: To use Pebble in Travis CI, we require the ability to mount a
## certificate on the autohttps pod, but we can't because that
## configuration ability was added after 0.9.0. Due to this
## autohttps is disabled here.
## The current dev-config.yaml require network policies to contain
## more pre-defined defaults to reach the DNS server not present
## in 0.9.0, and are due to this disabled.
- |
helm install jupyterhub jupyterhub/jupyterhub --values dev-config.yaml \
--set proxy.https.enabled=false \
--set hub.networkPolicy.enabled=false \
--set proxy.networkPolicy.enabled=false \
--set singleuser.networkPolicy.enabled=false
- await_jupyterhub
# Upgrade JupyterHub to what's locally available
- helm upgrade jupyterhub ./jupyterhub --values dev-config.yaml
- await_jupyterhub
- await_autohttps_tls_cert_acquisition
# Run tests
- pytest --verbose --exitfirst ./tests
- stage: test
name: chart:lint-and-validate
install:
- setup_helm
- setup_kubeval
- pip install yamllint
script:
- tools/templates/lint-and-validate.py --kubernetes-versions 1.11.0,1.14.0,1.18.0
- stage: test
name: docs:link-check
install:
- pip install --no-cache-dir -r doc/doc-requirements.txt
script:
- cd doc
- make html SPHINXOPTS='-W --keep-going'
- make linkcheck
- stage: publish
name: publish:helm-chart
install:
- pip install --no-cache-dir -r dev-requirements.txt
script:
- setup_helm
- remove_docker_mirror_on_travis
- ./ci/publish
env:
## encrypted environment variables DOCKER_USERNAME and DOCKER_PASSWORD,
## used in the publish script to push built docker images to docker hub.
##
## ref: https://docs.travis-ci.com/user/environment-variables/#encrypting-environment-variables
- secure: jpFpbMccpjGP+otWH2Z03VFdtR9AAu2vzrNxsoZ3IvJvrO4MfzYJ3uSCDQuB0NG9gBgaAscpTJtliPTEi7njXHLcsFeWXLUmeBEHLozYxfzDQzMvW3EYdNWcC7oVAAt3de0i0ojw9rGswiofhbu2dAe+Xd2bejv1+PVJcEC3SRPGy17kb6bme6gD3zty5ft4VpzP0nomUNqfZBRLUYxSZuKlHJaZ6Nuq434rKmXrcN6uy+eEWDorTbjyM22IIYgUmrhg++Qtu/MBR7/rriPhyRltCU14361bcxqyq2Hw+HNG8D3hsqo5TiEiYwxOQcXRgddL+Ci6/y0L1EvqOQc+1V8ycwNs2oNicwNgSn5A+9HpF495Kae039hGtj2Gpt4IbplSYwKFq/sFTq+CekxdD2YVQmGvsjep4bNVL66o2RSZVAW1Bg/G8/sSe3BwgD8IToy9+1NHPPuaVupeukRqNyUDcVvWH8hdb8AkXYY87+546etYDpn91GQnhTEberKbXX4UCmpKNXpXoprLE8nQLGb6TIoHPTyA+RRNQ4erDzMjqF43UVmhOZTtkGaRgIWK7vDAKpLUnuOguuhJUNpYpRggGQsMV8cZnaCumy5OFUf6i6rfN0Ru6a+/Bm7grJiAcnZlU7igaxgI38QaJgCKcqqzIImdcRYNQC74/Ok/1oM=
- secure: BK++GwKVPoS0iG8aB7wQ13daTgJR9MifHA+l9xr/tSZ3SUL6nc7kjxLbliRQJCqT9lcOODsd+v2u9PziEzBp0CCh67ftFxJw8riP2+FgdmHTK4yav9QpSwoBJHhV2SgBMGlXiqdUVC7wpgjzzK63V8abvzAhXkthWPl3kYpUI//xGYyuBNXVHEOImHB3F1M5bn90lflFtRfq2iH5FigGesMi2BFfTVeqvbzZVZrAs0E1/NRd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