From 67df42770d8645fa7a3c716f02c85033dc150ec9 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 20 Mar 2019 06:44:46 +0100 Subject: [PATCH] No longer package rabbit-openqa but add gocd config for it --- dist/package/openSUSE-release-tools.spec | 27 ----- gocd/monitors.gocd.yaml | 118 ++++++++++++++++++++++ rabbit-openqa.py => gocd/rabbit-openqa.py | 0 rabbit-repoid.py => gocd/rabbit-repoid.py | 0 systemd/osrt-rabbit-openqa.service | 10 -- 5 files changed, 118 insertions(+), 37 deletions(-) create mode 100644 gocd/monitors.gocd.yaml rename rabbit-openqa.py => gocd/rabbit-openqa.py (100%) rename rabbit-repoid.py => gocd/rabbit-repoid.py (100%) delete mode 100644 systemd/osrt-rabbit-openqa.service diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index 56314131..6f4e47ee 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -326,18 +326,6 @@ Requires: osc >= 0.159.0 %description -n osc-plugin-vdelreq OSC plugin to check for virtually accepted request, see `osc vdelreq --help`. -%package rabbit-openqa -Summary: Sync openQA Status Into OBS -Group: Development/Tools/Other -BuildArch: noarch -Requires: osc >= 0.159.0 -Requires: python2-openqa_client -Requires: python2-pika - -%description rabbit-openqa -Bot listening to AMQP bus and syncs openQA job status into OBS for -staging projects - %prep %setup -q @@ -452,14 +440,6 @@ fi %postun pkglistgen %systemd_postun -%pre rabbit-openqa -getent passwd osrt-rabbit-openqa > /dev/null || \ - useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-rabbit-openqa" osrt-rabbit-openqa -exit 0 - -%postun rabbit-openqa -%systemd_postun - %files %defattr(-,root,root,-) %doc README.md @@ -511,7 +491,6 @@ exit 0 %exclude %{_datadir}/%{source_dir}/osc-staging.py %exclude %{_datadir}/%{source_dir}/osc-vdelreq.py %exclude %{_datadir}/%{source_dir}/update_crawler.py -%exclude %{_datadir}/%{source_dir}/rabbit-openqa.py %dir %{_sysconfdir}/openSUSE-release-tools %files devel @@ -660,12 +639,6 @@ exit 0 %{_unitdir}/osrt-pkglistgen@.service %{_unitdir}/osrt-pkglistgen@.timer -%files rabbit-openqa -%defattr(-,root,root,-) -%{_bindir}/osrt-rabbit-openqa -%{_datadir}/%{source_dir}/rabbit-openqa.py -%{_unitdir}/osrt-rabbit-openqa.service - %files -n osclib %defattr(-,root,root,-) %{_datadir}/%{source_dir}/osclib diff --git a/gocd/monitors.gocd.yaml b/gocd/monitors.gocd.yaml new file mode 100644 index 00000000..c816c5fb --- /dev/null +++ b/gocd/monitors.gocd.yaml @@ -0,0 +1,118 @@ +format_version: 3 +pipelines: + openSUSE.openQA: + group: Monitors + lock_behavior: unlockWhenFinished + timer: + spec: 0 */5 * ? * * + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + materials: + git: + git: https://github.com/openSUSE/openSUSE-release-tools.git + branch: master + stages: + - Run: + approval: + type: manual + jobs: + Run: + timeout: 0 + resources: + - staging-bot + tasks: + - script: |- + ./gocd/rabbit-openqa.py -A https://api.opensuse.org + SUSE.openQA: + group: Monitors + lock_behavior: unlockWhenFinished + timer: + spec: 0 */5 * ? * * + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + materials: + git: + git: https://github.com/openSUSE/openSUSE-release-tools.git + branch: master + stages: + - Run: + approval: + type: manual + jobs: + Run: + timeout: 0 + resources: + - staging-bot + tasks: + # endless loop + - script: |- + ./gocd/rabbit-openqa.py -A https://api.suse.de + SUSE.Repo.Monitor: + group: Monitors + lock_behavior: unlockWhenFinished + timer: + spec: 0 */5 * ? * * + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + materials: + scripts: + git: https://github.com/openSUSE/openSUSE-release-tools.git + branch: master + destination: scripts + osc: + git: https://github.com/openSUSE/osc.git + branch: python3 + destination: osc + stages: + - Run: + approval: + type: manual + jobs: + Run: + timeout: 0 + resources: + - staging-bot + tasks: + # endless loop + - script: |- + git config --global user.email "coolo@suse.de" + git config --global user.name "GoCD Repo Monitor" + git clone git://botmaster.suse.de/suse-repos.git + cd suse-repos + ls -l + export PYTHONPATH=../osc:/usr/share/openSUSE-release-tools + python3 ../scripts/gocd/rabbit-repoid.py -A https://api.suse.de SUSE:SLE-15-SP1:GA + openSUSE.Repo.Monitor: + group: Monitors + lock_behavior: unlockWhenFinished + timer: + spec: 0 */5 * ? * * + environment_variables: + OSC_CONFIG: /home/go/config/oscrc-staging-bot + materials: + scripts: + git: https://github.com/openSUSE/openSUSE-release-tools.git + branch: master + destination: scripts + osc: + git: https://github.com/openSUSE/osc.git + branch: python3 + destination: osc + stages: + - Run: + approval: + type: manual + jobs: + Run: + timeout: 0 + resources: + - staging-bot + tasks: + # endless loop + - script: |- + git config --global user.email "coolo@suse.de" + git config --global user.name "GoCD Repo Monitor" + git clone git://botmaster.suse.de/opensuse-repos.git + cd opensuse-repos + export PYTHONPATH=../osc:/usr/share/openSUSE-release-tools + python3 ../scripts/gocd/rabbit-repoid.py -A https://api.opensuse.org openSUSE:Factory openSUSE:Leap diff --git a/rabbit-openqa.py b/gocd/rabbit-openqa.py similarity index 100% rename from rabbit-openqa.py rename to gocd/rabbit-openqa.py diff --git a/rabbit-repoid.py b/gocd/rabbit-repoid.py similarity index 100% rename from rabbit-repoid.py rename to gocd/rabbit-repoid.py diff --git a/systemd/osrt-rabbit-openqa.service b/systemd/osrt-rabbit-openqa.service deleted file mode 100644 index c0d797e4..00000000 --- a/systemd/osrt-rabbit-openqa.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=openSUSE Release Tools: Sync openQA status - -[Service] -User=osrt-rabbit-openqa -ExecStart=/usr/bin/osrt-rabbit-openqa -Restart=on-failure - -[Install] -WantedBy=multi-user.target