]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
jenkins-job-builder: skip the CVE jobs 2653/head
authorDavid Galloway <david.galloway@ibm.com>
Fri, 10 Jul 2026 22:51:10 +0000 (18:51 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Fri, 10 Jul 2026 22:51:10 +0000 (18:51 -0400)
Skip cve-pipeline and cve-source-dist in the update loop and exclude
them from the deletion pass so they aren't removed for lacking test
XML.  Changes to those jobs must be made manually by a Jenkins admin.

Signed-off-by: David Galloway <david.galloway@ibm.com>
cve-pipeline/config/definitions/cve-pipeline.yml
cve-source-dist/config/definitions/cve-source-dist.yml
jenkins-job-builder/build/build

index 5cc40607a45678c849c298d189390713c9a38957..621a59df69e09c28f9e012e54da10fb970e39f5a 100644 (file)
@@ -1,3 +1,5 @@
+# NOTE: This job is skipped by the jenkins-job-builder job.  Changes to it
+# must be made manually by a Jenkins admin.
 - job:
     name: cve-pipeline
     properties:
index 3e96d85d7d4ea4b882e0807da09e640742e4172d..c545ff28279006a1b8f426a72d87b8e4e326f31f 100644 (file)
@@ -1,3 +1,5 @@
+# NOTE: This job is skipped by the jenkins-job-builder job.  Changes to it
+# must be made manually by a Jenkins admin.
 - job:
     name: cve-source-dist
     description: This job is only called from https://jenkins.ceph.com/job/cve-pipeline.  The entire job and its artifacts are only visible to the ceph/security Github Team.
index 6d412914bbe225cdc458c8d970b9131f796e1ec5..8706c5cc2a4823c91a7b9342da4338dbe7e517fe 100644 (file)
@@ -46,6 +46,12 @@ TEMPDIR=$(mktemp -d)
 # Test every definition if available in the current repository and update the jobs
 # if they do define one (they should always define their definitions)
 for dir in `find . -maxdepth 1 -path ./.git -prune -o -type d -print`; do
+    # The CVE jobs are intentionally not managed here.  Changes to them must be
+    # made manually by a Jenkins admin.
+    if [[ "$dir" == "./cve-pipeline" || "$dir" == "./cve-source-dist" ]]; then
+        echo "skipping $dir: CVE jobs must be updated manually by a Jenkins admin"
+        continue
+    fi
     definitions_dir="$dir/config/definitions"
     if [ -d "$definitions_dir" ]; then
         echo "found definitions directory: $definitions_dir"
@@ -81,7 +87,10 @@ JJB_CONFIG="$HOME/.jenkins_jobs.$JENKINS_FQDN.ini"
 # jenkins-job-builder doesn't get a config written so we `grep -v it` so it doesn't get deleted.
 # Jobs that start with 'preserve-' will also be kept, as it's assumed they're jobs under
 # development that will be deleted (perhaps renamed) once development is finished.
-for JOB in $(curl -s https://$JENKINS_FQDN/api/json | jq -r '.jobs[].name' | egrep -v 'jenkins-job-builder|^preserve-' | sort); do
+# The cve-pipeline and cve-source-dist jobs are skipped above, so no XML gets written
+# for them during `jenkins-jobs test`.  Exclude them here so they don't get deleted;
+# changes to them must be made manually by a Jenkins admin.
+for JOB in $(curl -s https://$JENKINS_FQDN/api/json | jq -r '.jobs[].name' | egrep -v 'jenkins-job-builder|^preserve-|^cve-pipeline$|^cve-source-dist$' | sort); do
     if [ ! -f $TEMPDIR/$JOB ]; then
         echo "Did not find job definition for $JOB.  Deleting!"
         $VENV/jenkins-jobs --log_level DEBUG --conf $JJB_CONFIG delete $JOB