forked from containerbuildsystem/koji-containerbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoji-containerbuild.spec
410 lines (350 loc) · 17.3 KB
/
koji-containerbuild.spec
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif
%global module koji_containerbuild
Name: koji-containerbuild
Version: 0.7.7
Release: 2%{?dist}
Summary: Koji support for building layered container images
Group: Applications/System
License: LGPLv2
URL: https://github.com/release-engineering/%{name}
#Use the following commands to generate the tarball:
#
# git clone --single-branch --branch koji-containerbuild-VERSION-RELEASE \
# https://github.com/release-engineering/koji-containerbuild.git && \
# cd ./koji-containerbuild && \
# python setup.py sdist
#
#Where:
#- VERSION is version macro from specfile
#- RELEASE is release macro from specfile and dist is not defined (empty)
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
BuildRequires: python2-devel
BuildRequires: python-setuptools
%description
Koji support for building layered container images
%package hub
License: LGPLv2
Summary: Hub plugin that extend Koji to build layered container images
Group: Applications/System
Requires: koji-containerbuild
Requires: koji-hub
%description hub
Hub plugin that extend Koji to support building layered container images
%package builder
License: LGPLv2
Summary: Builder plugin that extend Koji to build layered container images
Group: Applications/System
Requires: koji-builder
Requires: koji-containerbuild
Requires: osbs-client
Requires: python-urlgrabber
Requires: python-dockerfile-parse
%description builder
Builder plugin that extend Koji to communicate with OpenShift build system and
build layered container images.
%package cli
License: LGPLv2
Summary: CLI that communicates with Koji to control building layered container images
Group: Applications/System
Requires: koji
Requires: koji-containerbuild
%description cli
Builder plugin that extend Koji to communicate with OpenShift build system and
build layered container images.
%prep
%setup -q
%build
%{__python2} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%{__install} -d $RPM_BUILD_ROOT%{_bindir}
%{__install} -p -m 0755 cli/koji-containerbuild $RPM_BUILD_ROOT%{_bindir}/koji-containerbuild
%{__install} -d $RPM_BUILD_ROOT%{_prefix}/lib/koji-hub-plugins
%{__install} -p -m 0644 %{module}/plugins/hub_containerbuild.py $RPM_BUILD_ROOT%{_prefix}/lib/koji-hub-plugins/hub_containerbuild.py
%{__install} -d $RPM_BUILD_ROOT%{_prefix}/lib/koji-builder-plugins
%{__install} -p -m 0644 %{module}/plugins/builder_containerbuild.py $RPM_BUILD_ROOT%{_prefix}/lib/koji-builder-plugins/builder_containerbuild.py
%files
%{python2_sitelib}/*
%doc docs AUTHORS README.rst
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?_licensedir:%global license %doc}
%endif
%license LICENSE
%files cli
%{_bindir}/*
%files hub
%{_prefix}/lib/koji-hub-plugins/hub_containerbuild.py*
%files builder
%{_prefix}/lib/koji-builder-plugins/builder_containerbuild.py*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Jan 16 2018 Robert Cerven <[email protected]> 0.7.7-2
- Disable rawhide testing ([email protected])
- Make Docker relabel the volume ([email protected])
- travis.yml: F25 is EOL, use F27 instead ([email protected])
- Disallow use of yum_repourls with compose_ids ([email protected])
- tests: install specific versions of test package to avoid test packages
update breaks ([email protected])
- Add compose_ids and signing_intent options ([email protected])
- Disallow private branches for non-scratch container builds
* Mon Nov 06 2017 Robert Cerven <[email protected]> 0.7.6-2
- Added docstring to CLI ([email protected])
- raise error when arches_override are used for non-scratch builds
* Wed Oct 04 2017 Robert Cerven <[email protected]> 0.7.5-2
- test.sh: install epel-release for centos first ([email protected])
- Run tests in Travis CI using containers ([email protected])
- setup.py: remove bogus install_requires ([email protected])
- Remove pycurl ([email protected])
- Add FileHandler for osbs module ([email protected])
- Fix test_cli_args unit test ([email protected])
- Remove kojid module loading ([email protected])
- Don't check for isolated option if flatpak is specified ([email protected])
- Use arch-override as str ([email protected])
- test_kcb: initial infra for improved logging self-tests/verification
- builder_containerbuild: clean up and simplify demux/non-demux split
- builder_containerbuild: write cleanups ([email protected])
- builder_containerbuild: use get_orchestrator_build_logs api
- Flatpak support ([email protected])
- Clean up container-build CLI ([email protected])
- cli: add --arches argument option ([email protected])
- cli: write a test case for the arguments parser ([email protected])
- tests: throw OsbsOrchestratorNotEnabled if available ([email protected])
* Tue Sep 05 2017 Robert Cerven <[email protected]> 0.7.4-1
- Use OsbsOrchestratorNotEnabled exception ([email protected])
- Add support for isolated builds ([email protected])
* Mon Jul 31 2017 Robert Cerven <[email protected]> 0.7.3-1
- Fix typo, koij -> koji ([email protected])
- Update API for koji 1.13 changes: * activate_session now requires two
parameters * _running_in_bg moved to koji_cli.lib ([email protected])
- fix tests, call correct koji api to cancel task
- add speculative message about osbs cancellation for autorebuild
- Cancel a koji task if the osbs task is cancelled
* Tue Apr 04 2017 Robert Cerven <[email protected]> 0.7.2-1
- check if pkg can be tagged ([email protected])
- orchestrator build can only successfully run if can_orchestrate option is
set, in osbs.conf otherwise will fallback to regular prod_build
- add unit testing for orchestrator builds ([email protected])
- Use osbs-client's create_orchestrator_build method if available
* Tue Nov 15 2016 Luiz Carvalho <[email protected]> 0.7.1-1
- Move long tag check in checkLabels ([email protected])
- Update tests and documentation after tasks have been merged
- Merge buildContainer and createContainer tasks ([email protected])
- Pick the longest tag correctly ([email protected])
- Pick the longest tag part among release and a list from additional-tags
- Reject a build if the longest tag is longer than 128 chars
- Trap build cancellation using signal handler ([email protected])
- tests: make tests work ([email protected])
- Cancel build when createContainer task is cancelled (throws
koji.GenericException) ([email protected])
- Drop support for release parameter ([email protected])
* Wed Jun 29 2016 Luiz Carvalho <[email protected]> 0.6.6-1
- Use osbs 'scratch' configuration for scratch builds ([email protected])
- Revert "Disable scratch builds" ([email protected])
- make streamed logs line-buffered ([email protected])
- Remove default value for release parameter ([email protected])
* Fri Jun 24 2016 Luiz Carvalho <[email protected]> 0.6.5-1
- Show build's error message if available ([email protected])
- Disable scratch builds ([email protected])
- Should use label 'Release' to set release ([email protected])
* Wed Jun 22 2016 Brendan Reilly <[email protected]> 0.6.4-1
- Fail createContainer if OpenShift build fails ([email protected])
- Added a few unit tests ([email protected])
- Make "Release" label optional ([email protected])
- Use correct object for session during nvr check and log the error
* Thu Jun 02 2016 Brendan Reilly <[email protected]> 0.6.3-1
- Fix task result output ([email protected])
- Handle release parameter ([email protected])
* Wed May 25 2016 Brendan Reilly <[email protected]> 0.6.2-1
- supply koji_task_id to osbs-client's create_build() ([email protected])
- no need to warn about build result not being JSON ([email protected])
- Use component label in nvr check ([email protected])
- Don't check NVR for scratch builds and move nvr check closer to build object
creation ([email protected])
- Don't start the build if package with this NVR already has been built
- Expose Koji CG build ID in CreateContainerTask ([email protected])
* Mon Apr 11 2016 Brendan Reilly <[email protected]> 0.6.1-1
- Reinstate _get_repositories() method (fixes #35) ([email protected])
- Add back in bits required for streaming logs (fixes #33) ([email protected])
* Thu Apr 07 2016 Brendan Reilly <[email protected]> 0.6.0-1
- remove un-necessary code for v2-only CG builds
- runBuilds: add debug for arches ([email protected])
- runBuilds make label unique and be able to build archfully ([email protected])
- Build process documentation - quick and dirty ([email protected])
* Mon Mar 14 2016 Pavol Babincak <[email protected]> 0.5.7-1
- Updated docs how to create a release ([email protected])
- add some post-install instructions ([email protected])
- incorporated new osbs api for compression fix ([email protected])
* Tue Mar 08 2016 Pavol Babincak <[email protected]> 0.5.6-1
- Backport spec file from Fedora ([email protected])
- Include docs in MANIFEST.in ([email protected])
- Use .md extension for build architecture ([email protected])
- quickfix for downloads always being .tar ([email protected])
- Channel override in CLI ([email protected])
- Build process documentation - quick and dirty ([email protected])
* Thu Feb 04 2016 Fedora Release Engineering <[email protected]> - 0.5.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Dec 04 2015 Pavol Babincak <[email protected]> 0.5.5-1
- Add README.rst to a release ([email protected])
- Use %%global macro instead of %%define one ([email protected])
- Require main package in subpackages to always install license file
- Add license directives to subpackages ([email protected])
* Thu Dec 03 2015 Pavol Babincak <[email protected]> 0.5.4-3
- Simplify inclusion of python modules to get proper owners
- Explicit __python2 definitions on <=rhel6 ([email protected])
- Explicit use of python2 and BuildRequires on python2-devel
- %%defattr macro isn't needed anymore ([email protected])
- Use %%license tag for license on RHEL && RHEL <= 6 ([email protected])
- Fix permissions for CLI binary ([email protected])
- Wrap package descriptions to make rpmlint happy ([email protected])
- Replace Requires on osbs with osbs-client ([email protected])
- Remove koji Requires from the base package ([email protected])
- Replace koji-builder with koji dependency for cli subpackage
- Specify how release tarballs are created ([email protected])
- Use build system instead of buildsystem to make rpmlint happy
- Fix name macro in URL ([email protected])
* Fri Nov 20 2015 Pavol Babincak <[email protected]> 0.5.4-2
- fix spec paths, libdir evals to /usr/lib64/ on 64-bit build hosts which is
the wrong path for koji plugins ([email protected])
* Fri Nov 20 2015 Pavol Babincak <[email protected]> 0.5.4-1
- Reinit curl after fork to properly process incremental logs
- Add support to new LABEL names and make architecture optional
- Fix serious issue: check external rpms for *non*scratch builds
- Catch errors raised by markExternalRPMs and raise it as koji.PostBuildError
- Get list of rpms and repositories only for successful builds
- Download image tarball only if build was successful ([email protected])
- Log list of all rpms from osbs response as formatted rpm list
- Refactor: get rpm packages to separate method ([email protected])
- Refactor: get docker repositories to separate method ([email protected])
- Fail only if build was successful and it haven't generated any tarball
- Improve log write related exception messages ([email protected])
- Raise ContainerError exceptions when something goes wrong with osbs logs
- Pass branch and push_url from opts to osbs's create_build()
- Uploader process check if child (which fetches logs) finished
- Overall docs about build architecture ([email protected])
- change log msg level to info ([email protected])
- Properly handle empty repositories in osbs response ([email protected])
- Wait between new connection/fetch logs ([email protected])
- Use get_build_name() instead of build_id to get osbs build id
* Tue Jul 14 2015 Pavol Babincak <[email protected]> 0.5.3-1
- List repositories in status message of buildContainer task
- Print osbs build id in the error message about failed build
- If not exactly one image was built leave fail to parent ([email protected])
- Use DockerfileParser class from dockerfile_parse module for parsing
- Download docker logs at the end of the build ([email protected])
- Try fetch OSBS logs with follow and incrementally upload them
- If final tarball cannot be downloaded log error and continue
- Accept repo URLs in CLI and pass it in builder plugin to osbs
- Improve error message when there were unexpected number of builds
- Fix: correctly format string before passing to ContainerError
- Fix formatting of README.rst ([email protected])
* Mon Jun 15 2015 Pavol Babincak <[email protected]> 0.5.2-1
- Use BZComponent LABEL instead of Name ([email protected])
* Fri Jun 12 2015 Pavol Babincak <[email protected]> 0.5.1-1
- Explicit string conversion before urlgrabber.urlgrab() and more logging
- Explicitly set urlgrab ssl verify options which pycurl expects
* Fri Jun 12 2015 Pavol Babincak <[email protected]> 0.5.0-1
- Read LABELs from Dockerfile ([email protected])
* Fri Jun 12 2015 Pavol Babincak <[email protected]> 0.4.0-1
- Download container image via https ([email protected])
- Tag package (image) after successful build if not scratch
* Tue Jun 09 2015 Pavol Babincak <[email protected]> 0.3.1-1
- Add missing import imp ([email protected])
* Mon Jun 08 2015 Pavol Babincak <[email protected]> 0.3.0-1
- Remove code which always overwrote release ([email protected])
- Removed not used imports ([email protected])
- Import kojipath from path set via variable not from inspection
- More debug info: list rpm_packages ([email protected])
- Mock image tarball as we don't get this from the buildsystem (yet)
- Pull getting task options to separate method ([email protected])
- Pull package (image) whitelist check into separate method
- Reuse image tables and methods for container builds ([email protected])
- Don't pass build_tag as separate argument to createContainer task
* Wed Jun 03 2015 Pavol Babincak <[email protected]> 0.2.0-2
- Don't require python-distutils. distutils is part of python-libs pkg
* Wed May 27 2015 Pavol Babincak <[email protected]> 0.2.0-1
- Explicitly list code which are hack around database constraints
- refactor: remove not used code and move comment to better position
- Get name from name of the basename repository for non-scratch builds
- Extend SCM object with get_component() and get_git_uri() and use it
- Use logger to write logs and not sys.stderr.write ([email protected])
- Use container_archives not image_archives table ([email protected])
- Use attributes of BuildResponse object to query responses
- Connect to osbs logger to print more debug info via own logger
- Improve rpm_packages listings ([email protected])
- Support non-scratch builds with listing of the contents ([email protected])
- builderplugin: import kojid binary as kojid module ([email protected])
- builderplugin: Use single handler to OSBS object ([email protected])
* Mon May 18 2015 Pavol Babincak <[email protected]> 0.1.2-1
- add BuildRoot tag (needed for rhel<6) ([email protected])
- use alternate method to import kojihub ([email protected])
* Wed May 13 2015 Pavol Babincak <[email protected]> 0.1.1-1
- Documentation for buildContainer task ([email protected])
- In buildContainer task use "container" channel by default
* Wed May 13 2015 Pavol Babincak <[email protected]> 0.1.0-2
- Bump Release instead of Version ([email protected])
- Use BuildArch noarch ([email protected])
* Mon May 04 2015 Pavol Babincak <[email protected]> 0.1.0-1
- first public release