blob: 3e648a55c5a534f02bc6a23c56772613fe255761 [file] [log] [blame]
%{?scl:%scl_package zuul}
%{!?scl:%global pkg_name %{name}}
%global nfsmountable 1
Name: %{?scl_prefix}zuul
Version: 3.10.2
Release: 2%{?dist}
Summary: Trunk Gating System
License: ASL 2.0
URL: https://zuul-ci.org/
# Use gitea because tarball published by openstack doesn't have symlinks.
# It's also smaller as it doesn't contain built html bundles.
Source0: https://opendev.org/zuul/zuul/archive/%{version}.tar.gz
Source2: zuul-scheduler.service
Source3: zuul-merger.service
Source4: zuul-executor.service
Source5: zuul-web.service
Source6: zuul-fingergw.service
Source10: topmenu.css
# -----BEGIN PATCH SECTION-----
# Optimization for multi gerrit account
Patch10: 0001-gerrit-add-support-for-report-only-connection.patch
# Config endpoint
Patch11: 0001-config-add-tenant.toDict-method-and-REST-endpoint.patch
# -----END PATCH SECTION-----
BuildArch: noarch
Requires: scl-utils
Requires: %{?scl_prefix}python
Requires: %{?scl_prefix}enable-py3
Requires: %{?scl_prefix}python-pbr
Requires: %{?scl_prefix}python-CacheControl
Requires: %{?scl_prefix}python-jwt
Requires: %{?scl_prefix}python-github3
Requires: %{?scl_prefix}PyYAML
Requires: %{?scl_prefix}python-paste
Requires: %{?scl_prefix}python-paramiko
Requires: %{?scl_prefix}GitPython
Requires: %{?scl_prefix}python-daemon
Requires: %{?scl_prefix}python-extras
Requires: %{?scl_prefix}python-statsd
Requires: %{?scl_prefix}python-voluptuous
Requires: %{?scl_prefix}python-gear
Requires: %{?scl_prefix}python-APScheduler
Requires: %{?scl_prefix}python-prettytable
Requires: %{?scl_prefix}python-babel
Requires: %{?scl_prefix}python-kazoo
Requires: %{?scl_prefix}python-sqlalchemy
Requires: %{?scl_prefix}python-alembic
Requires: %{?scl_prefix}python-PyMySQL
Requires: %{?scl_prefix}python-alembic
Requires: %{?scl_prefix}python-crypto
Requires: %{?scl_prefix}python-cherrypy
Requires: %{?scl_prefix}python-ws4py
Requires: %{?scl_prefix}python-routes
Requires: %{?scl_prefix}python-uvloop
Requires: %{?scl_prefix}python-netaddr
Requires: %{?scl_prefix}python-paho-mqtt
Requires: %{?scl_prefix}python-psutil
Requires: %{?scl_prefix}python-re2
Requires: %{?scl_prefix}python-CacheControl
Requires: %{?scl_prefix}python-cachetools
Requires: %{?scl_prefix}python-jsonpath-rw
BuildRequires: %{?scl_prefix}python-devel
BuildRequires: %{?scl_prefix}python-pbr
BuildRequires: %{?scl_prefix}python-setuptools
BuildRequires: systemd
%description
Zuul is a project gating system developed for the OpenStack Project.
%package webui
Summary: The Zuul web interface
BuildRequires: patternfly-react-ui-deps
%description webui
The Zuul web interface
%package scheduler
Summary: The Zuul scheduler
Requires: %{?scl_prefix}zuul
%description scheduler
The Zuul scheduler
%package merger
Summary: The Zuul merger
Requires: %{?scl_prefix}zuul
Requires: rh-git29-git
%description merger
The Zuul merger
%package web
Summary: The Zuul web
Requires: %{?scl_prefix}zuul
%description web
The Zuul web
%package executor
Summary: The Zuul executor
Requires: %{?scl_prefix}zuul
Requires: %{?scl_prefix}zuul-executor-ansible-25
Requires: %{?scl_prefix}zuul-executor-ansible-26
Requires: %{?scl_prefix}zuul-executor-ansible-27
Requires: %{?scl_prefix}zuul-executor-ansible-28
Requires: rh-git29-git
Requires: bubblewrap
%description executor
The Zuul executor
%package migrate
Summary: Migrate zuul v2 and Jenkins Job Builder to Zuul v3
Requires: %{?scl_prefix}zuul
Requires: bubblewrap
%description migrate
Migrate zuul v2 and Jenkins Job Builder to Zuul v3
%package fingergw
Summary: Executor finger gateway
Requires: %{?scl_prefix}zuul
%description fingergw
Executor finger gateway
%package doc
Summary: Zuul documentation
BuildRequires: %{?scl_prefix}python-zuul-sphinx
BuildRequires: %{?scl_prefix}python-snowballstemmer
BuildRequires: %{?scl_prefix}python-fixtures
BuildRequires: %{?scl_prefix}python-sphinx-autodoc-typehints
BuildRequires: %{?scl_prefix}python-sphinxcontrib-blockdiag
BuildRequires: %{?scl_prefix}python-sphinxcontrib-programoutput
BuildRequires: %{?scl_prefix}python-sphinxcontrib-openapi
BuildRequires: %{?scl_prefix}python-reno
BuildRequires: %{?scl_prefix}python-re2
BuildRequires: %{?scl_prefix}python-cherrypy
BuildRequires: %{?scl_prefix}GitPython
BuildRequires: graphviz
%description doc
Zuul documentation
%prep
%autosetup -n zuul -p1
# Remove static left-over
rm -Rf zuul/web/static
mkdir zuul/web/static
# Remove javascript build setup hook
rm -f zuul/_setup_hook.py
sed -i 's/.*zuul._setup_hook.setup_hook//' setup.cfg
# Remove python requirements
rm requirements.txt test-requirements.txt
# Inject package version
cat << EOF > zuul/version.py
is_release = True
release_string = "%{version}-%{release}"
class version_info:
def release_string():
return release_string
EOF
%build
%{?scl:scl enable %{scl} - << \EOF}
PBR_VERSION=%{version} %{__python3} setup.py build
# Create fake zuul client without requirements
cp zuul/cmd/client.py build/zuul
chmod +x build/zuul
sed -e 's/import babel.dates//' \
-e 's/import prettytable//' \
-e 's/import zuul.*//' \
-e 's/.*zuul.lib.config.*//' \
-e 's/zuul.cmd.ZuulApp//' \
-e 's/super.*createParser/argparse.ArgumentParser/' \
-e 's/Client().main()/Client().createParser().parse_args()/' -i build/zuul
# Generate documentation (without release note because source doesn't have git log)
sed -e 's/^ *releasenotes$//' -i doc/source/index.rst
rm doc/source/releasenotes.rst
PATH=$PATH:$(pwd)/build PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build \
-b html doc/source build/html
%{?scl:EOF}
pushd web
ln -s /opt/patternfly-react-ui-deps/node_modules/ node_modules
# Inject topmenu
cat %{SOURCE10} >> src/index.css
sed -e '5i <script type="text/javascript" src="/static/js/topmenu.js"></script>' \
-i public/index.html
# Fix zuul documentation link
sed -e 's#https://zuul-ci.org/docs#/docs/zuul#' \
-i src/App.jsx
PUBLIC_URL=/zuul/ ./node_modules/.bin/yarn build
popd
%install
install -p -d -m 0755 %{buildroot}/%{_datadir}/zuul
mv web/build/* %{buildroot}/%{_datadir}/zuul
%{?scl:scl enable %{scl} - << \EOF}
PBR_VERSION=%{version} %{__python3} setup.py install --skip-build --root %{buildroot}
%{?scl:EOF}
rm -Rf %{buildroot}%{python3_sitelib}/zuul/web/static
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{?scl_prefix}zuul-scheduler.service
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{?scl_prefix}zuul-merger.service
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{?scl_prefix}zuul-executor.service
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/%{?scl_prefix}zuul-web.service
install -p -D -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/%{?scl_prefix}zuul-fingergw.service
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 0700 %{buildroot}%{_sharedstatedir}/zuul
install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/zuul
# Fix LD_LIBRARY_PATH issues with bwrap
install -p -d -m 0755 %{buildroot}/usr/lib64
for lib in /opt/rh/rh-python35/root/lib64/libpython*; do
ln -s $lib %{buildroot}/usr/lib64/$(basename $lib)
done
ln -s /opt/rh/rh-python35/root/lib64/python3.5 %{buildroot}/usr/lib64/python3.5
# Prepare lib directory
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 %{?scl_prefix}zuul-scheduler.service
%post merger
%systemd_post %{?scl_prefix}zuul-merger.service
%post web
%systemd_post %{?scl_prefix}zuul-web.service
%post executor
%systemd_post %{?scl_prefix}zuul-executor.service
%post fingergw
%systemd_post %{?scl_prefix}zuul-fingergw.service
%preun scheduler
%systemd_preun %{?scl_prefix}zuul-scheduler.service
%preun merger
%systemd_preun %{?scl_prefix}zuul-merger.service
%preun web
%systemd_preun %{?scl_prefix}zuul-web.service
%preun executor
%systemd_preun %{?scl_prefix}zuul-executor.service
%preun fingergw
%systemd_preun %{?scl_prefix}zuul-fingergw.service
%postun scheduler
%systemd_postun %{?scl_prefix}zuul-scheduler.service
%postun merger
%systemd_postun %{?scl_prefix}zuul-merger.service
%postun web
%systemd_postun %{?scl_prefix}zuul-web.service
%postun executor
%systemd_postun %{?scl_prefix}zuul-executor.service
%postun fingergw
%systemd_postun %{?scl_prefix}zuul-fingergw.service
%files
%config(noreplace) %attr(0640, root, zuul) %{_sysconfdir}/zuul/zuul.conf
%config(noreplace) %{_sysconfdir}/zuul/logging.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
%{python3_sitelib}/zuul
%{python3_sitelib}/zuul-*.egg-info
%{_bindir}/zuul
%{_bindir}/zuul-bwrap
%files webui
%{_datadir}/zuul
%files scheduler
%{_bindir}/zuul-scheduler
%{_unitdir}/%{?scl_prefix}zuul-scheduler.service
%files merger
%{_bindir}/zuul-merger
%{_unitdir}/%{?scl_prefix}zuul-merger.service
%files web
%{_bindir}/zuul-web
%{_unitdir}/%{?scl_prefix}zuul-web.service
%files executor
%{_bindir}/zuul-executor
%{_bindir}/zuul-manage-ansible
%{_unitdir}/%{?scl_prefix}zuul-executor.service
%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible
%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/executor
/usr/lib64/*
%files migrate
%{_bindir}/zuul-migrate
%files fingergw
%{_bindir}/zuul-fingergw
%{_unitdir}/%{?scl_prefix}zuul-fingergw.service
%files doc
%doc LICENSE build/html
%changelog
* Wed Sep 18 2019 Fabien Boucher <fboucher@redhat.com> - 3.10.2-2
- Add some un-merged Pagure driver patches
* Tue Sep 17 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.10.2-1
- Add synchronize rsh security fix
* Thu Aug 15 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.10.1-1
- Bump to 3.10.1
* Mon May 20 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.8.1-3
- Add merger optimization
* Tue May 14 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.8.1-2
- Remove a couple of un-needed patches
* Wed May 8 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.8.1-1
- Bump to 3.8.1
- Remove React service worker
* Wed Apr 17 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.8.0-1
- Bump to 3.8.0
* Mon Mar 25 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.7.1-1
- Bump to 3.7.1
* Mon Mar 18 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.7.0-1
- Bump to 3.7.0
* Mon Feb 11 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.6.0-1
- Bump to 3.6.0
* Fri Feb 8 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.5.0-2
- Cherry-pick github fix
- Fix config endpoint
* Wed Jan 23 2019 Javier Peña <jpena@redhat.com> - 3.5.0-1
- Bump to 3.5.0
* Wed Jan 2 2019 Tristan Cacqueray <tdecacqu@redhat.com> - 3.4.0-1
- Bump to 3.4.0
* Thu Nov 29 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.3.1-1
- Update the openshift resources patches
- Use package version in the zuul.version module
* Tue Nov 6 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.3.0-1
- Bump to 3.3.0
* Mon Sep 24 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-6
- Add react web interface
* Wed Sep 19 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-5
- Bump to latest master
* Thu Aug 9 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-4
- Add timer trigger fix
* Mon Aug 6 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-3
- Add missing canonical name in scheduler status
* Sat Aug 4 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-2
- Add node age to webpage
* Mon Jul 30 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.2.0-1
- Bump version
* Wed Jul 18 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.1.0-5
- Bump to last master for ui fix
* Mon Jul 2 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.1.0-4
- Bump to 3.1.1 tech preview
* Fri Jun 22 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.1.0-3
- Add resource connection type patch
- Add patch to get the zuul-scheduler -t validation option
- Add /etc/localtime patch
* Thu Jun 21 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.1.0-2
- Fix tenant status page reload issue
- Add glyphicon status balls
* Fri Jun 15 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.1.0-1
- Bump version to 3.1.0
- Add angular6 patch
* Mon May 28 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.2-2
- Bump ansible patch to 2.5 version
* Fri Apr 13 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.2-1
- Update version to 3.0.2 release
- Update the MQTT driver patch
* Fri Apr 13 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.1-1
- Update version to 3.0.1 release
- Add patch to fix tag reporter
- Update the MQTT driver patch
* Thu Mar 29 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-26
- Update version to 3.0.0 release
* Tue Mar 20 2018 Fabien Boucher <fboucher@redhat.com> - 3.0.0-25
- Bump version for security fixes
- Add patches for supporting zuul to start with a broken config
* Fri Mar 16 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-24
- Bump version for security fixes
- Add new Nodepool dashboards
* Thu Mar 15 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-23
- Bump version
* Tue Mar 13 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-22
- Bump version
* Thu Feb 22 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-21
- Add missing ansible-2.4 fix
* Wed Feb 21 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-20
- Bump version
- Add branch-column patch
- Fix dynamic config loader
* Mon Feb 19 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-19
- Bump version and switch to ansible 2.4 requirement
* Wed Feb 07 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-18
- Bump version
- Add pipelines.json endpoint
* Wed Jan 31 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-17
- Bump version
- Add external webui built with npm
* Mon Jan 22 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-16
- Bump version
- Add config-loader optimization patch
- Add job page description patch
- Add dynamic config load
- Remove with_restart in systemd unit
- Add doc sub package
* Wed Dec 27 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-15
- Bump version
- Add jmespath to the executor requirements
- Add fingergw sub-package
- Add zookeeper retry logic patch
* Tue Dec 05 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-14
- Bump version
* Wed Nov 29 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-13
- Bump version
- Add MQTT driver patch
- Add log_stream options patch
* Fri Nov 17 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-12
- Force ssh known_host to be in scl user home
* Mon Nov 6 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-11
- Bump version and slightly update the patches
* Wed Nov 1 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-10
- Bump version and remove merged patches
* Wed Sep 27 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-9
- Add newrev patch
* Thu Sep 14 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-8
- Add zuul-web interfaces
* Tue Sep 05 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-7
- Add scheduler StartPost command to wait for gearman server.
* Fri Aug 25 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-6
- Fix zuul-web static file missing from python module
- Use common enable-py3 environment file
- Fix bwrap usage (LD_LIBRARY_PATH is removed by setuid)
- Bump version
* Tue Jul 25 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-5
- Bump version and fix executor reload
* Wed Jul 12 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-4
- Bump version and add zuul-web package
* Thu Jul 6 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-3
- Remove demonization from service file
* Thu Jun 29 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-2
- Fix service reload
* Mon Jun 19 2017 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-1
- Initial packaging