| |
@@ -0,0 +1,306 @@
|
| |
+ %global gitdate 20171227
|
| |
+ %global commit 420e8a460bda83e14b6063bc17f8649597b22d46
|
| |
+ %global shortcommit %(c=%{commit}; echo ${c:0:7})
|
| |
+
|
| |
+ Name: zuul
|
| |
+ Version: 3.0.0
|
| |
+ Release: 0.1.%{gitdate}git%{shortcommit}%{?dist}
|
| |
+ Summary: Trunk Gating System
|
| |
+
|
| |
+ License: ASL 2.0
|
| |
+ URL: http://docs.openstack.org/infra/system-config/
|
| |
+ Source0: https://github.com/openstack-infra/zuul/archive/%{commit}/zuul-%{version}.tar.gz
|
| |
+ Source1: zuul-scheduler.service
|
| |
+ Source2: zuul-merger.service
|
| |
+ Source3: zuul-executor.service
|
| |
+ Source4: zuul-web.service
|
| |
+ Source5: zuul-fingergw.service
|
| |
+ Source6: zuul.logrotate
|
| |
+
|
| |
+ BuildArch: noarch
|
| |
+
|
| |
+ Requires: python3
|
| |
+ Requires: python3-pbr
|
| |
+ Requires: python3-CacheControl
|
| |
+ Requires: python3-jwt
|
| |
+ Requires: python3-github3py
|
| |
+ Requires: python3-PyYAML
|
| |
+ Requires: python3-paste
|
| |
+ Requires: python3-webob
|
| |
+ Requires: python3-paramiko
|
| |
+ Requires: python3-GitPython
|
| |
+ Requires: python3-daemon
|
| |
+ Requires: python3-extras
|
| |
+ Requires: python3-iso8601
|
| |
+ Requires: python3-statsd
|
| |
+ Requires: python3-voluptuous
|
| |
+ Requires: python3-gear
|
| |
+ Requires: python3-APScheduler
|
| |
+ Requires: python3-prettytable
|
| |
+ Requires: python3-babel
|
| |
+ Requires: python3-kazoo
|
| |
+ Requires: python3-sqlalchemy
|
| |
+ Requires: python3-alembic
|
| |
+ Requires: python3-PyMySQL
|
| |
+ Requires: python3-alembic
|
| |
+ Requires: python3-crypto
|
| |
+ Requires: python3-aiohttp
|
| |
+ Requires: python3-uvloop
|
| |
+ Requires: python3-netaddr
|
| |
+ Requires: python3-paho-mqtt
|
| |
+ Requires: git
|
| |
+
|
| |
+ BuildRequires: python3-devel
|
| |
+ BuildRequires: python3-pbr
|
| |
+ BuildRequires: python3-setuptools
|
| |
+ BuildRequires: python3-zuul-sphinx
|
| |
+ BuildRequires: python3-sphinx-autodoc-typehints
|
| |
+ BuildRequires: python3-sphinxcontrib-blockdiag
|
| |
+ BuildRequires: python3-sphinxcontrib-programoutput
|
| |
+ BuildRequires: help2man
|
| |
+ %{?systemd_requires}
|
| |
+ BuildRequires: systemd
|
| |
+
|
| |
+
|
| |
+ %description
|
| |
+ Zuul is a project gating system developed for the OpenStack Project.
|
| |
+
|
| |
+
|
| |
+ %package scheduler
|
| |
+ Summary: The Zuul scheduler
|
| |
+ Requires: zuul
|
| |
+
|
| |
+ %description scheduler
|
| |
+ The Zuul scheduler
|
| |
+
|
| |
+
|
| |
+ %package merger
|
| |
+ Summary: The Zuul merger
|
| |
+ Requires: zuul
|
| |
+
|
| |
+ %description merger
|
| |
+ The Zuul merger
|
| |
+
|
| |
+
|
| |
+ %package web
|
| |
+ Summary: The Zuul web
|
| |
+ Requires: zuul
|
| |
+
|
| |
+ %description web
|
| |
+ The Zuul web
|
| |
+
|
| |
+
|
| |
+ %package executor
|
| |
+ Summary: The Zuul executor
|
| |
+ Requires: zuul
|
| |
+ Requires: ansible-python3
|
| |
+ Requires: python3-jmespath
|
| |
+ Requires: bubblewrap
|
| |
+
|
| |
+ %description executor
|
| |
+ The Zuul executor
|
| |
+
|
| |
+
|
| |
+ %package migrate
|
| |
+ Summary: Migrate zuul v2 and Jenkins Job Builder to Zuul v3
|
| |
+ Requires: zuul
|
| |
+ Requires: python3-jenkins-job-builder
|
| |
+
|
| |
+ %description migrate
|
| |
+ Migrate zuul v2 and Jenkins Job Builder to Zuul v3
|
| |
+
|
| |
+
|
| |
+ %package fingergw
|
| |
+ Summary: Executor finger gateway
|
| |
+ Requires: zuul
|
| |
+
|
| |
+ %description fingergw
|
| |
+ Executor finger gateway
|
| |
+
|
| |
+
|
| |
+ %package doc
|
| |
+ Summary: The Zuul documentation
|
| |
+
|
| |
+ %description doc
|
| |
+ The Zuul documentation
|
| |
+
|
| |
+
|
| |
+ %prep
|
| |
+ %autosetup -n zuul-%{commit} -p1
|
| |
+ rm -Rf *requirements.txt *.egg-info
|
| |
+
|
| |
+ # Add alembic __init__.py file, otherwise the migration script isn't packaged
|
| |
+ touch zuul/driver/sql/alembic/__init__.py \
|
| |
+ zuul/driver/sql/alembic/versions/__init__.py \
|
| |
+ zuul/ansible/filter/__init__.py
|
| |
+
|
| |
+ # Remove interpreter
|
| |
+ find zuul/ -type f -exec sed -i -e '/#!\/usr\/bin\/.*python.*/{1D}' {} \;
|
| |
+
|
| |
+
|
| |
+ %build
|
| |
+ PBR_VERSION=%{version} %py3_build
|
| |
+ PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build -b html doc/source build/html
|
| |
+
|
| |
+ rm -Rf build/html/.buildinfo build/html/objects.inv
|
| |
+
|
| |
+ # Generate man pages
|
| |
+ mkdir man
|
| |
+ pushd man
|
| |
+ echo -e "#!/usr/bin/python3\nimport sys\nfrom zuul.cmd.client import main\nmain()" > zuul
|
| |
+ echo -e "#!/usr/bin/python3\nimport sys\nfrom zuul.driver.bubblewrap import main\nmain()" > zuul-bwrap
|
| |
+ for subcmd in cloner executor fingergw merger migrate scheduler web; do
|
| |
+ echo -e "#!/usr/bin/python3\nimport sys\nfrom zuul.cmd.${subcmd} import main\nmain()" > zuul-${subcmd}
|
| |
+ done
|
| |
+ chmod +x zuul*
|
| |
+ for cmd in zuul*; do
|
| |
+ PYTHONPATH=.. help2man --no-discard-stderr --no-info -o ${cmd}.man ./${cmd}
|
| |
+ done
|
| |
+ popd
|
| |
+
|
| |
+
|
| |
+ %install
|
| |
+ PBR_VERSION=%{version} %py3_install
|
| |
+
|
| |
+ # Remove executable bit from libraries
|
| |
+ find %{buildroot}%{python3_sitelib}/zuul -type f -exec chmod -x {} \;
|
| |
+
|
| |
+ # Add zuul web static
|
| |
+ cp -R zuul/web/static %{buildroot}%{python3_sitelib}/zuul/web/static
|
| |
+
|
| |
+ # Man pages
|
| |
+ install -p -D -m 0644 man/zuul.man %{buildroot}%{_mandir}/man1/zuul.1
|
| |
+ for cmd in bwrap cloner executor fingergw merger migrate scheduler web; do
|
| |
+ install -p -D -m 0644 man/zuul-${cmd}.man %{buildroot}%{_mandir}/man1/zuul-${cmd}.1
|
| |
+ done
|
| |
+
|
| |
+ # Service unit
|
| |
+ install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/zuul-scheduler.service
|
| |
+ install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/zuul-merger.service
|
| |
+ install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/zuul-executor.service
|
| |
+ install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/zuul-web.service
|
| |
+ install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/zuul-fingergw.service
|
| |
+
|
| |
+ # Basic configuration
|
| |
+ install -p -D -m 0644 etc/logging.conf-sample %{buildroot}%{_sysconfdir}/zuul/logging.conf
|
| |
+ install -p -D -m 0640 etc/zuul.conf-sample %{buildroot}%{_sysconfdir}/zuul/zuul.conf
|
| |
+ install -p -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/zuul
|
| |
+
|
| |
+ # Service base directories
|
| |
+ install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul
|
| |
+ install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/zuul
|
| |
+ install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul/.ssh
|
| |
+ install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/ansible
|
| |
+ install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/executor
|
| |
+ install -p -d -m 0755 %{buildroot}%{_sharedstatedir}/zuul/git
|
| |
+ install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul/keys
|
| |
+
|
| |
+
|
| |
+ %pre
|
| |
+ getent group zuul >/dev/null || groupadd -r zuul
|
| |
+ if ! getent passwd zuul >/dev/null; then
|
| |
+ useradd -r -g zuul -G zuul -d %{_sharedstatedir}/zuul -s /sbin/nologin -c "Zuul Daemon" zuul
|
| |
+ fi
|
| |
+ exit 0
|
| |
+
|
| |
+
|
| |
+ %post scheduler
|
| |
+ %systemd_post zuul-scheduler.service
|
| |
+ %post merger
|
| |
+ %systemd_post zuul-merger.service
|
| |
+ %post web
|
| |
+ %systemd_post zuul-web.service
|
| |
+ %post executor
|
| |
+ %systemd_post zuul-executor.service
|
| |
+ %post fingergw
|
| |
+ %systemd_post zuul-fingergw.service
|
| |
+
|
| |
+
|
| |
+ %preun scheduler
|
| |
+ %systemd_preun zuul-scheduler.service
|
| |
+ %preun merger
|
| |
+ %systemd_preun zuul-merger.service
|
| |
+ %preun web
|
| |
+ %systemd_preun zuul-web.service
|
| |
+ %preun executor
|
| |
+ %systemd_preun zuul-executor.service
|
| |
+ %preun fingergw
|
| |
+ %systemd_preun zuul-fingergw.service
|
| |
+
|
| |
+
|
| |
+ %postun scheduler
|
| |
+ %systemd_postun zuul-scheduler.service
|
| |
+ %postun merger
|
| |
+ %systemd_postun zuul-merger.service
|
| |
+ %postun web
|
| |
+ %systemd_postun zuul-web.service
|
| |
+ %postun executor
|
| |
+ %systemd_postun zuul-executor.service
|
| |
+ %postun fingergw
|
| |
+ %systemd_postun zuul-fingergw.service
|
| |
+
|
| |
+
|
| |
+ %files
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul.1*
|
| |
+ %{_mandir}/man1/zuul-cloner.1*
|
| |
+ %{_mandir}/man1/zuul-bwrap.1*
|
| |
+ %{_bindir}/zuul
|
| |
+ %{_bindir}/zuul-cloner
|
| |
+ %{_bindir}/zuul-bwrap
|
| |
+ %{python3_sitelib}/zuul
|
| |
+ %{python3_sitelib}/zuul-*.egg-info
|
| |
+ %config(noreplace) %{_sysconfdir}/logrotate.d/zuul
|
| |
+ %config(noreplace) %{_sysconfdir}/zuul/logging.conf
|
| |
+ %config(noreplace) %attr(0640, root, zuul) %{_sysconfdir}/zuul/zuul.conf
|
| |
+ %dir %attr(0751, zuul, zuul) %{_sharedstatedir}/zuul
|
| |
+ %dir %attr(0700, zuul, zuul) %{_sharedstatedir}/zuul/.ssh
|
| |
+ %dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible
|
| |
+ %dir %attr(0700, zuul, zuul) %{_sharedstatedir}/zuul/keys
|
| |
+ %dir %attr(0750, zuul, zuul) %{_localstatedir}/log/zuul
|
| |
+
|
| |
+ %files scheduler
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-scheduler.1*
|
| |
+ %{_bindir}/zuul-scheduler
|
| |
+ %{_unitdir}/zuul-scheduler.service
|
| |
+
|
| |
+ %files merger
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-merger.1*
|
| |
+ %{_bindir}/zuul-merger
|
| |
+ %{_unitdir}/zuul-merger.service
|
| |
+
|
| |
+ %files web
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-web.1*
|
| |
+ %{_bindir}/zuul-web
|
| |
+ %{_unitdir}/zuul-web.service
|
| |
+
|
| |
+ %files executor
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-executor.1*
|
| |
+ %{_bindir}/zuul-executor
|
| |
+ %{_unitdir}/zuul-executor.service
|
| |
+ %dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible
|
| |
+ %dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/executor
|
| |
+
|
| |
+ %files migrate
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-migrate.1*
|
| |
+ %{_bindir}/zuul-migrate
|
| |
+
|
| |
+ %files fingergw
|
| |
+ %license LICENSE
|
| |
+ %{_mandir}/man1/zuul-fingergw.1*
|
| |
+ %{_bindir}/zuul-fingergw
|
| |
+ %{_unitdir}/zuul-fingergw.service
|
| |
+
|
| |
+ %files doc
|
| |
+ %license LICENSE
|
| |
+ %doc build/html
|
| |
+
|
| |
+
|
| |
+ %changelog
|
| |
+ * Tue Jan 09 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-0.1.20171227git420e8a4
|
| |
+ - Import from software factory repository
|
| |