/
weirdo-promote-puppet.yml
233 lines (228 loc) · 10.5 KB
/
weirdo-promote-puppet.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
- job:
name: weirdo-promote-puppet-properties
defaults: weirdo-defaults
description: |
<h3> Documentation: <a href=http://www.rdoproject.org/>http://www.rdoproject.org/</a> </h3>
<h3> Known issues: <a href=https://etherpad.openstack.org/p/delorean_master_current_issues>link</a> </h3>
<br>
This job's purpose is to write a persistent properties file that is stored as an artifact so it can be shared across different jobs.<br>
This is what it runs:<br>
<br>
<pre>
#!/bin/bash
set -xe
delorean_url="$(curl -s ${delorean_url} |awk -F= '/baseurl/ {print $2}')/delorean.repo"
cat << EOF > properties
#!/bin/bash
# The URL of the delorean .repo file tested against
export delorean_url=${delorean_url}
# The URL of the delorean-deps .repo file tested against
export delorean_deps_url=${delorean_deps_url}
# Version of integration tests used (master, stable/mitaka, stable/mitaka, etc.)
export version=${version}
# The name of the OpenStack release to use (master, newton, mitaka, etc.)
export openstack_release=${openstack_release}
# (For promotion purposes only) Internal delorean server
export delorean_internal_host=${delorean_internal_host}
# (For promotion purposes only) Public delorean server
export delorean_public_host=${delorean_public_host}
# (For promotion purposes only) Delorean builder to promote in
export delorean_builder=${delorean_builder}
# (For promotion purposes only) Symlink to promote
export promotion_symlink=${promotion_symlink}
# Boolean (true|false) to use puppet modules from rpm packages in p-o-i scenarios
export enable_puppet_modules_rpm=${enable_puppet_modules_rpm}
# Boolean (true|false) to deploy tempest from source instead of RPM
export tempest_from_source=${tempest_from_source}
EOF
</pre>
triggers:
- pollurl:
cron: "H */3 * * *"
urls:
- url: "https://trunk.rdoproject.org/centos7-master/consistent/delorean.repo"
check-content:
- simple: true
parameters:
- string:
name: delorean_url
default: https://trunk.rdoproject.org/centos7-master/consistent/delorean.repo
description: The URL of the delorean .repo file tested against
- string:
name: delorean_deps_url
default: https://trunk.rdoproject.org/centos7-master/delorean-deps.repo
description: The URL of the delorean-deps .repo file tested against
- string:
name: version
default: master
description: Version of integration tests used (master, stable/newton, stable/mitaka, etc.)
- string:
name: openstack_release
default: master
description: The name of the OpenStack release to use (master, newton, mitaka, etc.)
- string:
name: delorean_internal_host
default: trunk-primary.rdoproject.org
description: (For promotion purposes only) Internal delorean server
- string:
name: delorean_public_host
default: trunk.rdoproject.org
description: (For promotion purposes only) Public delorean server
- string:
name: delorean_builder
default: centos-master-uc
description: (For promotion purposes only) Delorean builder to promote in
- string:
name: promotion_symlink
default: puppet-passed-ci
description: (For promotion purposes only) Symlink to promote
- string:
name: enable_puppet_modules_rpm
default: false
description: Boolean (true|false) to use puppet modules from rpm packages in puppet-openstack-integration scenarios. Defaults to false.
- string:
name: tempest_from_source
default: false
description: Boolean (true|false) to deploy tempest from source instead of RPM. Defaults to false.
builders:
- shell: |
#!/bin/bash
set -xe
delorean_url="$(curl -s ${delorean_url} |awk -F= '/baseurl/ {print $2}')/delorean.repo"
cat << EOF > properties
#!/bin/bash
# The URL of the delorean .repo file tested against
export delorean_url=${delorean_url}
# The URL of the delorean-deps .repo file tested against
export delorean_deps_url=${delorean_deps_url}
# Version of integration tests used (master, stable/mitaka, etc.)
export version=${version}
# The name of the OpenStack release to use (master, newton, mitaka, etc.)
export openstack_release=${openstack_release}
# (For promotion purposes only) Internal delorean server
export delorean_internal_host=${delorean_internal_host}
# (For promotion purposes only) Public delorean server
export delorean_public_host=${delorean_public_host}
# (For promotion purposes only) Delorean builder to promote in
export delorean_builder=${delorean_builder}
# (For promotion purposes only) Symlink to promote
export promotion_symlink=${promotion_symlink}
# For puppet promotion pipeline we deploy puppet from source as done in upstream gates
export enable_puppet_modules_rpm=${enable_puppet_modules_rpm}
# For puppet promotion pipeline we deploy tempest from rpm as done in upstream gates
export tempest_from_source=${tempest_from_source}
EOF
publishers:
- archive:
artifacts: 'properties'
allow-empty: true
- trigger-parameterized-builds:
- project: 'weirdo-promote-test-puppet'
predefined-parameters: properties=https://ci.centos.org/job/${JOB_NAME}/${BUILD_NUMBER}/artifact/properties
current-parameters: false
condition: SUCCESS
- email:
recipients: 'infra@lists.rdoproject.org'
- job:
name: weirdo-promote-test-puppet
defaults: weirdo-defaults
description: |
<h3> Documentation: <a href=http://www.rdoproject.org/>http://www.rdoproject.org/</a> </h3>
<h3> Known issues: <a href=https://etherpad.openstack.org/p/delorean_master_current_issues>link</a> </h3>
<br>
This job's purpose is to trigger testing jobs.<br>
If all the testing jobs are successful, it will trigger a repository promotion.
parameters:
- string:
name: properties
default:
description: The URL to a properties file to be sourced prior to the build
builders:
- shell: |
#!/bin/bash
# If a properties file is specified, retrieve it to store it as an artifact of the job
if [[ -n "${properties}" ]]; then
curl -s -O ${properties}
fi
- trigger-builds:
- project:
- 'weirdo-generic-puppet-openstack-scenario001'
- 'weirdo-generic-puppet-openstack-scenario002'
- 'weirdo-generic-puppet-openstack-scenario003'
- 'weirdo-generic-puppet-openstack-scenario004'
predefined-parameters: properties=$properties
block: true
block-thresholds:
build-step-failure-threshold: 'FAILURE'
unstable-threshold: 'FAILURE'
failure-threshold: 'FAILURE'
publishers:
- archive:
artifacts: 'properties'
allow-empty: true
- trigger-parameterized-builds:
- project: 'weirdo-promote-puppet-symlink'
predefined-parameters: properties=https://ci.centos.org/job/${JOB_NAME}/${BUILD_NUMBER}/artifact/properties
current-parameters: false
condition: SUCCESS
- email:
recipients: 'infra@lists.rdoproject.org'
wrappers:
- ansicolor
- timestamps
- workspace-cleanup
- job:
name: weirdo-promote-puppet-symlink
defaults: weirdo-defaults
description: |
<h3> Documentation: <a href=http://www.rdoproject.org/>http://www.rdoproject.org/</a> </h3>
<h3> Known issues: <a href=https://etherpad.openstack.org/p/delorean_master_current_issues>link</a> </h3>
<br>
This job's purpose is to promote a symlink if it's upstream jobs have been successful.
This is what it runs:<br>
<br>
<pre>
#!/bin/bash
set -xe
# A properties file crafted from the upstream properties job is required
if [[ -n "${properties}" ]]; then
curl -s -O "${properties}"
source "./$(basename ${properties})"
else
exit 1
fi
promotion_hash=$(echo ${delorean_url} |awk -F/ '{ print $7}')
# Promote on the internal and public dlrn servers
ssh_opts="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/rhos-ci -p 3300"
for host in "${delorean_internal_host} ${delorean_public_host}"; do
ssh ${ssh_opts} promoter@${host} "sudo /usr/local/bin/promote.sh ${promotion_hash} ${delorean_builder} ${promotion_symlink}"
done
</pre>
parameters:
- string:
name: properties
default:
description: The URL to a properties file to be sourced prior to the build
builders:
- shell: |
#!/bin/bash
set -xe
# A properties file crafted from the upstream properties job is required
if [[ -n "${properties}" ]]; then
curl -s -O "${properties}"
source "./$(basename ${properties})"
else
exit 1
fi
promotion_hash=$(echo ${delorean_url} |awk -F/ '{ print $7}')
# Promote on the internal and public dlrn servers
ssh_opts="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${HOME}/.ssh/rhos-ci -p 3300"
for host in ${delorean_internal_host} ${delorean_public_host}; do
ssh ${ssh_opts} promoter@${host} "sudo /usr/local/bin/promote.sh ${promotion_hash} ${delorean_builder} ${promotion_symlink}"
done
publishers:
- archive:
artifacts: 'properties'
allow-empty: true
- email:
recipients: 'infra@lists.rdoproject.org'