-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathJenkinsfile
51 lines (49 loc) · 1.56 KB
/
Jenkinsfile
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
@Library('juju-pipeline@master') _
def juju_model = String.format("%s-%s", params.model, uuid())
def juju_controller = String.format("%s-%s", params.controller, uuid())
pipeline {
agent {
label 'runner-cloud'
}
/* XXX: Global $PATH setting doesn't translate properly in pipelines
https://stackoverflow.com/questions/43987005/jenkins-does-not-recognize-command-sh
*/
environment {
PATH = "${utils.cipaths}"
}
options {
ansiColor('xterm')
timestamps()
}
stages {
stage('Deploy: K8s') {
options {
timeout(time: 1, unit: 'HOURS')
}
steps {
sh "juju bootstrap ${params.cloud} ${juju_controller} --bootstrap-constraints arch=amd64"
deployCDK(controller: juju_controller,
model: juju_model,
bundle: "cs:~containers/${params.bundle}",
version_overlay: params.overlay,
bundle_channel: params.bundle_channel,
disable_wait: true)
sh "juju-wait -e ${juju_controller}:${juju_model} -w"
}
}
stage('Validate') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh "juju run-action kubernetes-worker/0 pause --wait"
sh "juju run-action kubernetes-worker/0 resume --wait"
}
}
}
post {
cleanup {
tearDown(params.controller)
}
}
}