-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
80 lines (67 loc) · 2.57 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
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
#!groovy
def msg
def artifactId
def releaseId
def additionalArtifactIds
def allTaskIds = [] as Set
pipeline {
agent none
options {
buildDiscarder(logRotator(daysToKeepStr: '3', artifactNumToKeepStr: '100'))
skipDefaultCheckout()
}
triggers {
ciBuildTrigger(
noSquash: true,
providerList: [
rabbitMQSubscriber(
name: 'RabbitMQ',
overrides: [
topic: 'org.fedoraproject.prod.bodhi.update.status.testing.koji-build-group.build.complete',
queue: 'osci-pipelines-queue-14'
],
checks: [
[field: '$.update.release.dist_tag', expectedValue: '^f[3-9]{1}[0-9]{1}$']
]
)
]
)
}
parameters {
string(name: 'CI_MESSAGE', defaultValue: '{}', description: 'CI Message')
}
stages {
stage('Trigger Testing') {
steps {
script {
msg = readJSON text: CI_MESSAGE
if (msg) {
if (msg['update']['builds'].size() > 20) {
echo "There are way too many (${msg['update']['builds'].size()} > 20) builds in the update. Skipping..."
return
}
msg['artifact']['builds'].each { build ->
allTaskIds.add(build['task_id'])
}
def testProfile = msg['update']['release']['dist_tag']
if (allTaskIds) {
allTaskIds.each { taskId ->
artifactId = "koji-build:${taskId}"
additionalArtifactIds = allTaskIds.findAll{ it != taskId }.collect{ "koji-build:${it}" }.join(',')
build(
job: 'fedora-ci/installability-pipeline/master',
wait: false,
parameters: [
string(name: 'ARTIFACT_ID', value: artifactId),
string(name: 'ADDITIONAL_ARTIFACT_IDS',value: additionalArtifactIds),
string(name: 'TEST_PROFILE',value: testProfile)
]
)
}
}
}
}
}
}
}
}