-
Notifications
You must be signed in to change notification settings - Fork 5
/
.cico.pipeline
77 lines (66 loc) · 2.46 KB
/
.cico.pipeline
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
#!groovy
/**
* This is a Jenkins Pipeline Jenkinsfile.
*
* You can read documentation about this file at https://jenkins.io/doc/book/pipeline/jenkinsfile/.
* A useful list of plugins can be found here: https://jenkins.io/doc/pipeline/steps/.
*
* For reference, this is the source of the fedoraInfraTox() macro that runs
* tox on mutiple Fedora releases:
* https://github.com/centosci/cico-shared-library/blob/master/vars/fedoraInfraTox.groovy
*/
// fedoraInfraTox{}
/**
* Distros we want to test on
*/
def ACTIVE_DISTROS = ["f31", "f32", "latest"]
def stages = [:]
def fedora_containers = [
containerTemplate(name: 'jnlp',
image: "docker-registry.default.svc:5000/openshift/cico-workspace:latest",
ttyEnabled: false,
args: '${computer.jnlpmac} ${computer.name}',
workingDir: "/workdir")
]
ACTIVE_DISTROS.each { fedora ->
stages["tox-${fedora}"] = {
stage("tox-${fedora}"){
container("${fedora}"){
sh "mkdir -p /workdir/home/${fedora}"
withEnv(["HOME=/workdir/home/${fedora}"]) {
sh "cp -al ./ ../${fedora}/"
dir( "../${fedora}" ){
sh "rm -rf .tox"
try {
sh "tox --skip-missing-interpreters"
githubNotify context: "CI on ${fedora}", status: 'SUCCESS'
} catch(error) {
githubNotify context: "CI on ${fedora}", status: 'FAILURE'
throw error
}
}
}
}
}
}
fedora_containers.add(containerTemplate(name: "${fedora}",
image: "quay.io/centosci/python-tox:${fedora}",
ttyEnabled: true,
alwaysPullImage: true,
command: "cat",
workingDir: '/workdir'))
}
podTemplate(name: 'fedora-tox',
label: 'fedora-tox',
cloud: 'openshift',
containers: fedora_containers
){
node('fedora-tox'){
ansiColor('xterm'){
stage ('checkout'){
checkout scm
}
parallel stages
}
}
}