aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2023-01-02 18:01:18 -0800
committerDan Fandrich <danf@mageia.org>2024-01-25 01:17:42 -0800
commit40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7 (patch)
treec05ff904f0c9c2d36b03570d22eda897bb577e8c
parentfeaf6f2dd50357a7886e05b09a4b6299bde8eb8d (diff)
downloadpuppet-40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7.tar
puppet-40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7.tar.gz
puppet-40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7.tar.bz2
puppet-40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7.tar.xz
puppet-40f8d6f10f0ad687e9bfc0f711fbe19257abb8a7.zip
Run the spec-rpm-mismatch report daily on duvel
The report will be available at https://pkgsubmit.mageia.org/spec-rpm-mismatch.html
-rw-r--r--manifests/nodes/duvel.pp1
-rw-r--r--modules/spec-tree-reports/manifests/init.pp50
-rw-r--r--modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report9
3 files changed, 60 insertions, 0 deletions
diff --git a/manifests/nodes/duvel.pp b/manifests/nodes/duvel.pp
index 4aa85cad..70bbb242 100644
--- a/manifests/nodes/duvel.pp
+++ b/manifests/nodes/duvel.pp
@@ -19,6 +19,7 @@ node duvel {
include mga_buildsystem::mainnode
include softwarekey
include mgasoft
+ include spec-tree-reports
include access_classes::committers
include restrictshell::allow_git
diff --git a/modules/spec-tree-reports/manifests/init.pp b/modules/spec-tree-reports/manifests/init.pp
new file mode 100644
index 00000000..5623090b
--- /dev/null
+++ b/modules/spec-tree-reports/manifests/init.pp
@@ -0,0 +1,50 @@
+# spec-rpm-mismatch is a report that compares the versions of RPMs available
+# in the repository versus the versions created by the latest spec files and
+# shows those that don't match.
+
+class spec-tree-reports(
+ $report = '/var/www/bs/spec-rpm-mismatch.html',
+ $srpms = 'file:///distrib/bootstrap/distrib/{version}/SRPMS/{media}/{section}/',
+ $release = "mga${buildsystem::var::distros::distros['cauldron']['version']}",
+) {
+ $user = 'spec-tree-reports'
+ $home = "/var/lib/${user}"
+ $hour = 6
+ $minute = 39
+
+ user { $user:
+ comment => 'spec-tree report generator',
+ home => $home,
+ }
+
+ file { $home:
+ ensure => directory,
+ owner => $user,
+ mode => '0755',
+ }
+
+ package { 'spec-tree':
+ ensure => installed,
+ }
+
+ file { "${report}":
+ ensure => present,
+ owner => $user,
+ mode => '0644',
+ replace => false,
+ content => '*',
+ }
+
+ mga_common::local_script { 'generate-spec-rpm-mismatch-report':
+ content => template('spec-tree-reports/generate-spec-rpm-mismatch-report'),
+ }
+
+ cron { "rpm_mismatch_report":
+ command => "/usr/local/bin/generate-spec-rpm-mismatch-report | systemd-cat -t generate-spec-rpm-mismatch-report",
+ hour => $hour,
+ minute => $minute,
+ user => $user,
+ environment => "MAILTO=root",
+ require => User[$user],
+ }
+}
diff --git a/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report b/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report
new file mode 100644
index 00000000..25f866d0
--- /dev/null
+++ b/modules/spec-tree-reports/templates/generate-spec-rpm-mismatch-report
@@ -0,0 +1,9 @@
+#!/bin/bash
+# GENERATED BY PUPPET--DO NOT EDIT
+set -e
+trap 'test "$?" -ne 0 && echo Error in script' EXIT
+
+cd "$HOME"
+/usr/bin/generate-mismatch-report --srpm_source <%= scope.function_shellquote([scope.lookupvar('srpms')]) -%> --release <%= scope.function_shellquote([scope.lookupvar('release')]) %>
+cp report.html <%= scope.function_shellquote([scope.lookupvar('report')]) %>
+rm -f report.html