-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
85 lines (73 loc) · 1.85 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
81
82
83
84
85
#!groovy
properties(
[
parameters(
[
string(description: 'CI Message', defaultValue: '', name: 'CI_MESSAGE'),
]
),
pipelineTriggers(
[
[
$class: 'CIBuildTrigger',
noSquash: true,
providerData: [
$class: 'RabbitMQSubscriberProviderData',
name: 'RabbitMQ',
overrides: [
topic: 'org.fedoraproject.prod.buildsys.tag',
queue: 'osci-pipelines-queue-12'
],
checks: [
[
expectedValue: '^f36$',
field: '$.tag'
]
]
]
]
]
)
]
)
def msg
pipeline {
options {
// Big number of archive tasks made DOS for Jenkins master
buildDiscarder(logRotator(daysToKeepStr: '14', numToKeepStr: '500', artifactNumToKeepStr: '100'))
}
agent any
stages {
stage('Trigger build') {
steps {
script {
msg = readJSON text: CI_MESSAGE
// Example:
// {
// "owner":"hobbes1069",
// "instance":"primary",
// "build_id":1530872,
// "release":"1.fc33",
// "name":"js8call",
// "tag_id":18667,
// "tag":"f33",
// "version":"2.2.0",
// "user":"bodhi"
// }
pkgName = msg['name']
kojiBuildID = msg['build_id'].toString()
build (
job: 'eln-build-pipeline',
wait: false,
parameters:
[
string(name: 'KOJI_BUILD_ID', value: kojiBuildID),
])
}
script {
currentBuild.description = "${pkgName}: ${kojiBuildID}"
}
}
}
}
}