From e5b85f5b2ea58f3a4eed7e39e420da5b4fe06204 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: May 20 2020 11:21:55 +0000 Subject: Import 3.18 from SF packaging --- diff --git a/0001-Remove-another-shebang-and-remove-useless-exec-bits.patch b/0001-Remove-another-shebang-and-remove-useless-exec-bits.patch new file mode 100644 index 0000000..991660c --- /dev/null +++ b/0001-Remove-another-shebang-and-remove-useless-exec-bits.patch @@ -0,0 +1,58 @@ +From 6feb399854ef55a3e43c5a46c56fae487dcd8d28 Mon Sep 17 00:00:00 2001 +From: Fabien Boucher +Date: Tue, 19 May 2020 14:40:51 +0200 +Subject: [PATCH] Remove another shebang and remove useless exec bits + +Change-Id: Id49bc9a4b50948b1f07e4fa917c93acac0c2a17e +--- + zuul/cmd/__init__.py | 0 + zuul/cmd/client.py | 0 + zuul/cmd/executor.py | 0 + zuul/cmd/merger.py | 5 ----- + zuul/cmd/scheduler.py | 0 + zuul/cmd/web.py | 0 + 6 files changed, 5 deletions(-) + mode change 100755 => 100644 zuul/cmd/__init__.py + mode change 100755 => 100644 zuul/cmd/client.py + mode change 100755 => 100644 zuul/cmd/executor.py + mode change 100755 => 100644 zuul/cmd/merger.py + mode change 100755 => 100644 zuul/cmd/scheduler.py + mode change 100755 => 100644 zuul/cmd/web.py + +diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py +old mode 100755 +new mode 100644 +diff --git a/zuul/cmd/client.py b/zuul/cmd/client.py +old mode 100755 +new mode 100644 +diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py +old mode 100755 +new mode 100644 +diff --git a/zuul/cmd/merger.py b/zuul/cmd/merger.py +old mode 100755 +new mode 100644 +index 1d4b6fef..9b827427 +--- a/zuul/cmd/merger.py ++++ b/zuul/cmd/merger.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2012 Hewlett-Packard Development Company, L.P. + # Copyright 2013-2014 OpenStack Foundation + # +@@ -69,7 +68,3 @@ class Merger(zuul.cmd.ZuulDaemonApp): + + def main(): + Merger().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/cmd/scheduler.py b/zuul/cmd/scheduler.py +old mode 100755 +new mode 100644 +diff --git a/zuul/cmd/web.py b/zuul/cmd/web.py +old mode 100755 +new mode 100644 +-- +2.25.1 + diff --git a/0001-Remove-ununecessary-shebangs.patch b/0001-Remove-ununecessary-shebangs.patch new file mode 100644 index 0000000..f0b8954 --- /dev/null +++ b/0001-Remove-ununecessary-shebangs.patch @@ -0,0 +1,199 @@ +From 31b83dd2e8ae808d65a0b5a8672dd244d3ce9a0e Mon Sep 17 00:00:00 2001 +From: Fabien Boucher +Date: Mon, 18 May 2020 18:49:27 +0200 +Subject: [PATCH] Remove ununecessary shebangs + +The commands are managed as entry-points so remove +ununecessary shebangs. Also lib/re2util.py does not +require a shebang as well. + +zuul_return.py does not have a main and is not supposed +to be run directly. + +Ununecessary shebangs for non executable script causes +rpmlint issues. + +Change-Id: I6015daaa0fe35b6935fcbffca1907c01c9a26134 +--- + zuul/ansible/base/actiongeneral/zuul_return.py | 2 -- + zuul/cmd/__init__.py | 1 - + zuul/cmd/client.py | 5 ----- + zuul/cmd/executor.py | 5 ----- + zuul/cmd/fingergw.py | 1 - + zuul/cmd/manage_ansible.py | 5 ----- + zuul/cmd/migrate.py | 6 ------ + zuul/cmd/scheduler.py | 5 ----- + zuul/cmd/web.py | 5 ----- + zuul/lib/re2util.py | 1 - + zuul/web/__init__.py | 14 -------------- + 11 files changed, 50 deletions(-) + +diff --git a/zuul/ansible/base/actiongeneral/zuul_return.py b/zuul/ansible/base/actiongeneral/zuul_return.py +index 903bab69..772aed02 100644 +--- a/zuul/ansible/base/actiongeneral/zuul_return.py ++++ b/zuul/ansible/base/actiongeneral/zuul_return.py +@@ -1,5 +1,3 @@ +-#!/usr/bin/python +- + # Copyright (c) 2017 Red Hat + # + # This module is free software: you can redistribute it and/or modify +diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py +index 77e5458e..e66128d0 100755 +--- a/zuul/cmd/__init__.py ++++ b/zuul/cmd/__init__.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2012 Hewlett-Packard Development Company, L.P. + # Copyright 2013 OpenStack Foundation + # +diff --git a/zuul/cmd/client.py b/zuul/cmd/client.py +index 6fc9128a..49d6ea9a 100755 +--- a/zuul/cmd/client.py ++++ b/zuul/cmd/client.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2012 Hewlett-Packard Development Company, L.P. + # Copyright 2013 OpenStack Foundation + # +@@ -735,7 +734,3 @@ class Client(zuul.cmd.ZuulApp): + + def main(): + Client().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py +index ceb422eb..7b77aed8 100755 +--- a/zuul/cmd/executor.py ++++ b/zuul/cmd/executor.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2012 Hewlett-Packard Development Company, L.P. + # Copyright 2013-2014 OpenStack Foundation + # +@@ -120,7 +119,3 @@ class Executor(zuul.cmd.ZuulDaemonApp): + + def main(): + Executor().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/cmd/fingergw.py b/zuul/cmd/fingergw.py +index 92aac714..63a54010 100644 +--- a/zuul/cmd/fingergw.py ++++ b/zuul/cmd/fingergw.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2017 Red Hat, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); you may +diff --git a/zuul/cmd/manage_ansible.py b/zuul/cmd/manage_ansible.py +index cc046ad5..e9a5287f 100644 +--- a/zuul/cmd/manage_ansible.py ++++ b/zuul/cmd/manage_ansible.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2019 BMW Group + # + # Licensed under the Apache License, Version 2.0 (the "License"); you may +@@ -96,7 +95,3 @@ class ManageAnsible(zuul.cmd.ZuulApp): + + def main(): + ManageAnsible().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/cmd/migrate.py b/zuul/cmd/migrate.py +index c132a8ca..7fe1d12a 100644 +--- a/zuul/cmd/migrate.py ++++ b/zuul/cmd/migrate.py +@@ -1,5 +1,3 @@ +-#!/usr/bin/env python +- + # Copyright 2017 Red Hat, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); you may +@@ -1744,7 +1742,3 @@ def main(): + + ZuulMigrate(args.layout, args.job_config, args.nodepool_config, + args.outdir, args.mapping, args.syntax_check).run() +- +- +-if __name__ == '__main__': +- main() +diff --git a/zuul/cmd/scheduler.py b/zuul/cmd/scheduler.py +index 308118f0..b5169346 100755 +--- a/zuul/cmd/scheduler.py ++++ b/zuul/cmd/scheduler.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2012 Hewlett-Packard Development Company, L.P. + # Copyright 2013 OpenStack Foundation + # +@@ -196,7 +195,3 @@ class Scheduler(zuul.cmd.ZuulDaemonApp): + + def main(): + Scheduler().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/cmd/web.py b/zuul/cmd/web.py +index fe4b2ca4..82274fd5 100755 +--- a/zuul/cmd/web.py ++++ b/zuul/cmd/web.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright 2017 Red Hat, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); you may +@@ -134,7 +133,3 @@ class WebServer(zuul.cmd.ZuulDaemonApp): + + def main(): + WebServer().main() +- +- +-if __name__ == "__main__": +- main() +diff --git a/zuul/lib/re2util.py b/zuul/lib/re2util.py +index b5cb2cba..5d80ae09 100644 +--- a/zuul/lib/re2util.py ++++ b/zuul/lib/re2util.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright (C) 2020 Red Hat, Inc + # + # Licensed under the Apache License, Version 2.0 (the "License"); +diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py +index d6df14c5..bae963a7 100755 +--- a/zuul/web/__init__.py ++++ b/zuul/web/__init__.py +@@ -1,4 +1,3 @@ +-#!/usr/bin/env python + # Copyright (c) 2017 Red Hat + # + # Licensed under the Apache License, Version 2.0 (the "License"); +@@ -1271,16 +1270,3 @@ class ZuulWeb(object): + return + self.repl.stop() + self.repl = None +- +- +-if __name__ == "__main__": +- logging.basicConfig(level=logging.DEBUG) +- import zuul.lib.connections +- import zuul.lib.auth.authenticators +- connections = zuul.lib.connections.ConnectionRegistry() +- auths = zuul.lib.auth.authenticators.AuthenticatorRegistry() +- z = ZuulWeb(listen_address="127.0.0.1", listen_port=9000, +- gear_server="127.0.0.1", gear_port=4730, +- connections=connections, authenticators=auths) +- z.start() +- cherrypy.engine.block() +-- +2.25.1 + diff --git a/README.fedora b/README.fedora new file mode 100644 index 0000000..4f9d2a1 --- /dev/null +++ b/README.fedora @@ -0,0 +1,68 @@ +zuul-manage-ansible +------------------- + +sudo -u zuul bash +cd +zuul-manage-ansible -u +ls -al /usr/lib/zuul/ansible/ + + +zuul-scheduler +-------------- + +Add in /etc/zuul/main.yaml: +- tenant: + name: demo-tenant + source: + local_git: + config-projects: + - zuul-config + +Install zookeeper with nodepool tests.yml +Comment MQTT section from zuul.conf +Comment Gerrit section +Comment the MySQL section + +systemctl start zuul-scheduler + +zuul-executor +------------- + +systemctl start zuul-executor + + +prepare basic config +-------------------- + +In zuul.conf add: +[connection local_git] +driver=git +baseurl=http://localhost:8000/home/fedora +poll_delay=300 + + +pip3 install --user dulwich +dulwich web-daemon -l 0.0.0.0 / +git init /home/fedora/zuul-config +vim /home/fedora/zuul-config/.zuul.yaml +- pipeline: + name: periodic + post-review: true + description: Jobs in this queue are triggered every minute. + manager: independent + precedence: low + trigger: + timer: + - time: '* * * * *' + +- project: + periodic: + jobs: + - noop +git config user.name "John Doe" +git config user.email "john@localhost" +git add .zuul.yaml +git commit -m"Init demo config" + +Dans les logs /var/log/zuul/zuul.log +zuul.ExecutorClient: [e: 3f6a0ad4b46f4a9aa23744e3e6b9eea5] Execute job noop diff --git a/dead.package b/dead.package deleted file mode 100644 index 09b8255..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Incomplete diff --git a/zuul-executor.service b/zuul-executor.service new file mode 100644 index 0000000..bf00a50 --- /dev/null +++ b/zuul-executor.service @@ -0,0 +1,15 @@ +[Unit] +Description=Zuul Executor Service +After=network.target + +[Service] +Type=simple +User=zuul +Group=zuul +SyslogIdentifier=zuul-executor +EnvironmentFile=-/etc/sysconfig/zuul +ExecStart=/usr/bin/zuul-executor -f +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/zuul-fingergw.service b/zuul-fingergw.service new file mode 100644 index 0000000..71a832f --- /dev/null +++ b/zuul-fingergw.service @@ -0,0 +1,14 @@ +[Unit] +Description=Zuul Finger Gateway Service +After=network.target + +[Service] +Type=simple +User=root +Group=root +SyslogIdentifier=zuul-fingergw +EnvironmentFile=-/etc/sysconfig/zuul +ExecStart=/usr/bin/zuul-fingergw -f + +[Install] +WantedBy=multi-user.target diff --git a/zuul-merger.service b/zuul-merger.service new file mode 100644 index 0000000..3f035da --- /dev/null +++ b/zuul-merger.service @@ -0,0 +1,15 @@ +[Unit] +Description=Zuul Merger Service +After=network.target + +[Service] +Type=simple +User=zuul +Group=zuul +LimitNOFILE=8192 +SyslogIdentifier=zuul-merger +EnvironmentFile=-/etc/sysconfig/zuul +ExecStart=/usr/bin/zuul-merger -f + +[Install] +WantedBy=multi-user.target diff --git a/zuul-scheduler.service b/zuul-scheduler.service new file mode 100644 index 0000000..5083062 --- /dev/null +++ b/zuul-scheduler.service @@ -0,0 +1,15 @@ +[Unit] +Description=Zuul Scheduler Service +After=network.target + +[Service] +Type=simple +User=zuul +Group=zuul +SyslogIdentifier=zuul-scheduler +EnvironmentFile=-/etc/sysconfig/zuul +ExecStart=/usr/bin/zuul-scheduler -f +ExecReload=/usr/bin/zuul-scheduler smart-reconfigure + +[Install] +WantedBy=multi-user.target diff --git a/zuul-web.service b/zuul-web.service new file mode 100644 index 0000000..acddd1a --- /dev/null +++ b/zuul-web.service @@ -0,0 +1,14 @@ +[Unit] +Description=Zuul Web Service +After=network.target + +[Service] +Type=simple +User=zuul +Group=zuul +SyslogIdentifier=zuul-web +EnvironmentFile=-/etc/sysconfig/zuul +ExecStart=/usr/bin/zuul-web -f + +[Install] +WantedBy=multi-user.target diff --git a/zuul.conf.sample b/zuul.conf.sample new file mode 100644 index 0000000..68a2251 --- /dev/null +++ b/zuul.conf.sample @@ -0,0 +1,83 @@ +[gearman] +server=127.0.0.1 +;port=4730 +;ssl_ca=/path/to/ca.pem +;ssl_cert=/path/to/client.pem +;ssl_key=/path/to/client.key + +[statsd] +server=127.0.0.1 + +[zookeeper] +hosts=127.0.0.1:2181 + +[gearman_server] +start=true +;ssl_ca=/path/to/ca.pem +;ssl_cert=/path/to/server.pem +;ssl_key=/path/to/server.key +;port=4730 + +[scheduler] +tenant_config=/etc/zuul/main.yaml +log_config=/etc/zuul/logging.conf +pidfile=/var/run/zuul/zuul.pid +state_dir=/var/lib/zuul + +[merger] +git_dir=/var/lib/zuul/git +;git_user_email=zuul@example.com +;git_user_name=zuul + +[executor] +default_username=zuul +log_config=/etc/zuul/logging.conf +trusted_ro_paths=/opt/zuul-scripts:/var/cache +trusted_rw_paths=/opt/zuul-logs + +[web] +listen_address=127.0.0.1 +port=9000 +static_cache_expiry=0 +status_url=https://zuul.example.com/status + +[webclient] +url=https://zuul.example.com +verify_ssl=true + +[auth zuul_operator] +driver=HS256 +allow_authz_override=true +realm=zuul.example.com +default=true +client_id=zuul.example.com +issuer_id=zuul_operator +secret=NoDanaOnlyZuul +max_validity_time=36000 +skew=0 + +;[connection gerrit] +;driver=gerrit +;server=review.example.com +;baseurl=https://review.example.com/r +;user=jenkins +;sshkey=/home/jenkins/.ssh/id_rsa +;keepalive=60 + +[connection smtp] +driver=smtp +server=localhost +port=25 +default_from=zuul@example.com +default_to=you@example.com + +;[connection mqtt] +;driver=mqtt +;server=localhost +;user=zuul +;password=zuul +;keepalive=60 + +;[connection mydatabase] +;driver=sql +;dburi=mysql+pymysql://user@localhost/zuul diff --git a/zuul.rpmlintrc b/zuul.rpmlintrc new file mode 100644 index 0000000..0d27cbf --- /dev/null +++ b/zuul.rpmlintrc @@ -0,0 +1,3 @@ +addFilter("E: devel-dependency python3-devel") +addFilter("E: non-readable /etc/zuul/zuul.conf 640") +addFilter("E: non-executable-script /usr/lib/python3.8/site-packages/zuul/ansible/base/library/.*") diff --git a/zuul.spec b/zuul.spec new file mode 100644 index 0000000..fc677d5 --- /dev/null +++ b/zuul.spec @@ -0,0 +1,557 @@ +%global srcname zuul + +Name: zuul +Version: 3.18.0 +Release: 2%{?dist} +Summary: Trunk Gating System + +License: ASL 2.0 +URL: https://zuul-ci.org +Source0: %pypi_source + +Source2: zuul-scheduler.service +Source3: zuul-merger.service +Source4: zuul-executor.service +Source5: zuul-web.service +Source6: zuul-fingergw.service +Source7: README.fedora +Source8: zuul.conf.sample + +Patch01: 0001-Remove-ununecessary-shebangs.patch +Patch02: 0001-Remove-another-shebang-and-remove-useless-exec-bits.patch + +BuildArch: noarch + +Requires(pre): shadow-utils +Requires: python3-pbr +Requires: python3-CacheControl +Requires: python3-jwt +Requires: python3-github3py +Requires: python3-pyyaml +Requires: python3-paste +Requires: python3-paramiko +Requires: python3-GitPython +Requires: python3-daemon +Requires: python3-extras +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-PyMySQL +Requires: python3-alembic +Requires: python3-crypto +Requires: python3-cherrypy +Requires: python3-ws4py +Requires: python3-routes +Requires: python3-uvloop +Requires: python3-netaddr +Requires: python3-paho-mqtt +Requires: python3-psutil +Requires: python3-fb-re2 +Requires: python3-cachetools +Requires: python3-jsonpath-rw +Requires: python3-psycopg2 +Requires: python3-dateutil +Requires: python3-iso8601 + +BuildRequires: python3-devel +BuildRequires: python3-pbr +BuildRequires: python3-setuptools +BuildRequires: systemd +BuildRequires: python3-zuul-sphinx +BuildRequires: python3-snowballstemmer +BuildRequires: python3-fixtures +BuildRequires: python3-sphinx-autodoc-typehints +BuildRequires: python3-sphinxcontrib-blockdiag +BuildRequires: python3-sphinxcontrib-programoutput +BuildRequires: python3-sphinxcontrib-openapi +BuildRequires: python3-reno +BuildRequires: python3-CacheControl +BuildRequires: python3-jwt +BuildRequires: python3-github3py +BuildRequires: python3-pyyaml +BuildRequires: python3-paste +BuildRequires: python3-paramiko +BuildRequires: python3-GitPython +BuildRequires: python3-daemon +BuildRequires: python3-extras +BuildRequires: python3-statsd +BuildRequires: python3-voluptuous +BuildRequires: python3-gear +BuildRequires: python3-APScheduler +BuildRequires: python3-prettytable +BuildRequires: python3-babel +BuildRequires: python3-kazoo +BuildRequires: python3-sqlalchemy +BuildRequires: python3-PyMySQL +BuildRequires: python3-alembic +BuildRequires: python3-crypto +BuildRequires: python3-cherrypy +BuildRequires: python3-ws4py +BuildRequires: python3-routes +BuildRequires: python3-uvloop +BuildRequires: python3-netaddr +BuildRequires: python3-paho-mqtt +BuildRequires: python3-psutil +BuildRequires: python3-fb-re2 +BuildRequires: python3-cachetools +BuildRequires: python3-jsonpath-rw +BuildRequires: python3-psycopg2 +BuildRequires: python3-dateutil +BuildRequires: python3-iso8601 +BuildRequires: ansible + + +%description +Zuul is a program that drives continuous integration, delivery, +and deployment systems with a focus on project gating and +interrelated projects. + + +%package webui +Summary: The Zuul web interface + +%description webui +This package provides the Zuul web interface source code. +Please refers to README.fedora for build and deployment instruction. + +%package scheduler +Summary: The Zuul scheduler service +Requires: zuul + +%description scheduler +The main Zuul process. Handles receiving events, executing jobs, +collecting results and posting reports. Coordinates the work of +the other components. It also provides a gearman daemon which +the other components use for coordination. + + +%package merger +Summary: The Zuul merger service +Requires: zuul + +%description merger +Scale-out component that performs git merge operations. +Zuul performs a large number of git operations in the course of +its work. Adding merger processes can help speed Zuul’s processing. +This component is optional (zero or more of these can be run). + + +%package web +Summary: The Zuul web service + +%description web +A web server that receives “webhook” events from external providers, +supplies a web dashboard, and provides websocket access to live +streaming of logs. + + +%package executor +Summary: The Zuul executor service +Requires: zuul +Requires: git +Requires: bubblewrap +# zuul-manage-ansible requires them to create ansible virtualenvs +Requires: python3-virtualenv +Requires: gcc +Requires: python3-devel + +%description executor +Scale-out component for executing jobs. At least one of these is +required. Depending on system configuration, you can expect a single +executor to handle up to about 100 simultaneous jobs. Can handle +the functions of a merger if dedicated mergers are not provided. +One or more of these must be run. + + +%package fingergw +Summary: Executor finger gateway service +Requires: zuul + +%description fingergw +A gateway which provides finger protocol access to live streaming of logs. + +%package migrate +Summary: Migrate zuul v2 and Jenkins Job Builder to Zuul v3 +Requires: zuul +Requires: bubblewrap + +%description migrate +Migrate zuul v2 and Jenkins Job Builder to Zuul v3 + +%package doc +Summary: Zuul documentation + +%description doc +The Zuul HTML documentation + + +%prep +%autosetup -n zuul-%{version} -p1 +rm requirements.txt test-requirements.txt +# remove extra uneeded shebangs in zuul_return +# archive on pypi do not preserve links +# could be removed at next release +find zuul/ansible/ -type f -name "zuul_return.py" \ + -exec sed -i '/\/usr\/bin\/python/d' {} \; + +# 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 +# Fix non compliant shebangs +find zuul/ansible/ -type f -name "*.py" \ + -exec sed -i "s|\#\!/usr/bin/python|\#\!/usr/bin/python3|" {} \; +install -m 0644 %{SOURCE7} README.fedora + +%build +%py3_build + +# Create fake zuul clients suitable for sphinx programoutput +cp zuul/cmd/client.py build/zuul +sed -i '1i \#!/usr/bin/env python3' build/zuul +chmod +x build/zuul +cp zuul/cmd/manage_ansible.py build/zuul-manage-ansible +sed -i '1i \#!/usr/bin/env python3' build/zuul-manage-ansible +chmod +x build/zuul-manage-ansible +# Generate documentation (without release note because source doesn't have git log) +sed -e 's/^ *releasenotes$//' -i doc/source/reference/index.rst +rm doc/source/reference/releasenotes.rst +PYTHONPATH=../../build/lib PATH=$PATH:$(pwd)/build PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build-3 \ + -b html doc/source build/html +# Remove empty stub files +find build -type f -name "*.pyi" -size 0 -delete + +%install +install -p -d -m 0755 %{buildroot}/%{_datadir}/zuul-ui +mv web/* %{buildroot}/%{_datadir}/zuul-ui/ +%py3_install +rm -Rf %{buildroot}%{python3_sitelib}/zuul/web/static +install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/zuul-scheduler.service +install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/zuul-merger.service +install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/zuul-executor.service +install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/zuul-web.service +install -p -D -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/zuul-fingergw.service +install -p -D -m 0644 etc/logging.conf-sample %{buildroot}%{_sysconfdir}/zuul/logging.conf +install -p -D -m 0640 %{SOURCE8} %{buildroot}%{_sysconfdir}/zuul/zuul.conf +install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/zuul +install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/zuul + +# 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 +install -p -d -m 0755 %{buildroot}%{_libdir}/zuul/ + + +%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 +%config(noreplace) %attr(0640, root, zuul) %{_sysconfdir}/zuul/zuul.conf +%config(noreplace) %{_sysconfdir}/zuul/logging.conf +%dir %attr(0755, 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(0755, zuul, zuul) %{_localstatedir}/log/zuul +%dir %attr(0755, zuul, zuul) %{_libdir}/zuul +%{python3_sitelib}/zuul +%{python3_sitelib}/zuul-*.egg-info +%{_bindir}/zuul +%{_bindir}/zuul-bwrap + +%files webui +%{_datadir}/zuul-ui + +%files scheduler +%{_bindir}/zuul-scheduler +%{_unitdir}/zuul-scheduler.service + +%files merger +%{_bindir}/zuul-merger +%{_unitdir}/zuul-merger.service + +%files web +%{_bindir}/zuul-web +%{_unitdir}/zuul-web.service + +%files executor +%{_bindir}/zuul-executor +%{_bindir}/zuul-manage-ansible +%{_unitdir}/zuul-executor.service +%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/ansible +%dir %attr(0755, zuul, zuul) %{_sharedstatedir}/zuul/executor + +%files fingergw +%{_bindir}/zuul-fingergw +%{_unitdir}/zuul-fingergw.service + +%files migrate +%{_bindir}/zuul-migrate + +%files doc +%doc build/html LICENSE README.fedora + + +%changelog +* Wed Mar 11 2020 Fabien Boucher - 3.18.0-2 +- Fedora rawhide compat + +* Tue Mar 3 2020 Tristan Cacqueray - 3.18.0-1 +- Bump to 3.18.0 +- Use -f argument for services +- Use smart-reconfigure command for scheduler reload + +* Wed Feb 26 2020 Tristan Cacqueray - 3.13.0-2 +- Add security fix + +* Tue Dec 10 2019 Fabien Boucher - 3.13.0-1 +- Bump to 3.13.0 + +* Tue Oct 22 2019 Fabien Boucher - 3.11.1-1 +- Bump to 3.11.1 + +* Mon Sep 23 2019 Tristan Cacqueray - 3.10.2-2 +- Remove SCL leftovers + +* Tue Sep 17 2019 Tristan Cacqueray - 3.10.2-1 +- Add synchronize rsh security fix + +* Thu Aug 15 2019 Tristan Cacqueray - 3.10.1-1 +- Bump to 3.10.1 + +* Mon May 20 2019 Tristan Cacqueray - 3.8.1-3 +- Add merger optimization + +* Tue May 14 2019 Tristan Cacqueray - 3.8.1-2 +- Remove a couple of un-needed patches + +* Wed May 8 2019 Tristan Cacqueray - 3.8.1-1 +- Bump to 3.8.1 +- Remove React service worker + +* Wed Apr 17 2019 Tristan Cacqueray - 3.8.0-1 +- Bump to 3.8.0 + +* Mon Mar 25 2019 Tristan Cacqueray - 3.7.1-1 +- Bump to 3.7.1 + +* Mon Mar 18 2019 Tristan Cacqueray - 3.7.0-1 +- Bump to 3.7.0 + +* Mon Feb 11 2019 Tristan Cacqueray - 3.6.0-1 +- Bump to 3.6.0 + +* Fri Feb 8 2019 Tristan Cacqueray - 3.5.0-2 +- Cherry-pick github fix +- Fix config endpoint + +* Wed Jan 23 2019 Javier Peña - 3.5.0-1 +- Bump to 3.5.0 + +* Wed Jan 2 2019 Tristan Cacqueray - 3.4.0-1 +- Bump to 3.4.0 + +* Thu Nov 29 2018 Tristan Cacqueray - 3.3.1-1 +- Update the openshift resources patches +- Use package version in the zuul.version module + +* Tue Nov 6 2018 Tristan Cacqueray - 3.3.0-1 +- Bump to 3.3.0 + +* Mon Sep 24 2018 Tristan Cacqueray - 3.2.0-6 +- Add react web interface + +* Wed Sep 19 2018 Tristan Cacqueray - 3.2.0-5 +- Bump to latest master + +* Thu Aug 9 2018 Tristan Cacqueray - 3.2.0-4 +- Add timer trigger fix + +* Mon Aug 6 2018 Tristan Cacqueray - 3.2.0-3 +- Add missing canonical name in scheduler status + +* Sat Aug 4 2018 Tristan Cacqueray - 3.2.0-2 +- Add node age to webpage + +* Mon Jul 30 2018 Tristan Cacqueray - 3.2.0-1 +- Bump version + +* Wed Jul 18 2018 Tristan Cacqueray - 3.1.0-5 +- Bump to last master for ui fix + +* Mon Jul 2 2018 Tristan Cacqueray - 3.1.0-4 +- Bump to 3.1.1 tech preview + +* Fri Jun 22 2018 Tristan Cacqueray - 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 - 3.1.0-2 +- Fix tenant status page reload issue +- Add glyphicon status balls + +* Fri Jun 15 2018 Tristan Cacqueray - 3.1.0-1 +- Bump version to 3.1.0 +- Add angular6 patch + +* Mon May 28 2018 Tristan Cacqueray - 3.0.2-2 +- Bump ansible patch to 2.5 version + +* Fri Apr 13 2018 Tristan Cacqueray - 3.0.2-1 +- Update version to 3.0.2 release +- Update the MQTT driver patch + +* Fri Apr 13 2018 Tristan Cacqueray - 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 - 3.0.0-26 +- Update version to 3.0.0 release + +* Tue Mar 20 2018 Fabien Boucher - 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 - 3.0.0-24 +- Bump version for security fixes +- Add new Nodepool dashboards + +* Thu Mar 15 2018 Tristan Cacqueray - 3.0.0-23 +- Bump version + +* Tue Mar 13 2018 Tristan Cacqueray - 3.0.0-22 +- Bump version + +* Thu Feb 22 2018 Tristan Cacqueray - 3.0.0-21 +- Add missing ansible-2.4 fix + +* Wed Feb 21 2018 Tristan Cacqueray - 3.0.0-20 +- Bump version +- Add branch-column patch +- Fix dynamic config loader + +* Mon Feb 19 2018 Tristan Cacqueray - 3.0.0-19 +- Bump version and switch to ansible 2.4 requirement + +* Wed Feb 07 2018 Tristan Cacqueray - 3.0.0-18 +- Bump version +- Add pipelines.json endpoint + +* Wed Jan 31 2018 Tristan Cacqueray - 3.0.0-17 +- Bump version +- Add external webui built with npm + +* Mon Jan 22 2018 Tristan Cacqueray - 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 - 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 - 3.0.0-14 +- Bump version + +* Wed Nov 29 2017 Tristan Cacqueray - 3.0.0-13 +- Bump version +- Add MQTT driver patch +- Add log_stream options patch + +* Fri Nov 17 2017 Tristan Cacqueray - 3.0.0-12 +- Force ssh known_host to be in scl user home + +* Mon Nov 6 2017 Tristan Cacqueray - 3.0.0-11 +- Bump version and slightly update the patches + +* Wed Nov 1 2017 Tristan Cacqueray - 3.0.0-10 +- Bump version and remove merged patches + +* Wed Sep 27 2017 Tristan Cacqueray - 3.0.0-9 +- Add newrev patch + +* Thu Sep 14 2017 Tristan Cacqueray - 3.0.0-8 +- Add zuul-web interfaces + +* Tue Sep 05 2017 Tristan Cacqueray - 3.0.0-7 +- Add scheduler StartPost command to wait for gearman server. + +* Fri Aug 25 2017 Tristan Cacqueray - 3.0.0-6 +- Fix zuul-web static file missing from python module +- Fix bwrap usage (LD_LIBRARY_PATH is removed by setuid) +- Bump version + +* Tue Jul 25 2017 Tristan Cacqueray - 3.0.0-5 +- Bump version and fix executor reload + +* Wed Jul 12 2017 Tristan Cacqueray - 3.0.0-4 +- Bump version and add zuul-web package + +* Thu Jul 6 2017 Tristan Cacqueray - 3.0.0-3 +- Remove demonization from service file + +* Thu Jun 29 2017 Tristan Cacqueray - 3.0.0-2 +- Fix service reload + +* Mon Jun 19 2017 Tristan Cacqueray - 3.0.0-1 +- Initial packaging