Trigger binnmus via curl
authorChristoph Berg <myon@debian.org>
Fri, 12 Jan 2024 09:31:18 +0000 (10:31 +0100)
committerChristoph Berg <myon@debian.org>
Fri, 12 Jan 2024 09:31:18 +0000 (10:31 +0100)
jenkins/trigger-binnmu [new file with mode: 0755]
jenkins/trigger-job
jenkins/trigger-source-rebuild

diff --git a/jenkins/trigger-binnmu b/jenkins/trigger-binnmu
new file mode 100755 (executable)
index 0000000..549e15d
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Rebuild a source package and then trigger a binary build.
+
+set -eu
+
+while getopts "d:r:" opt ; do
+  case $opt in
+    d) distribution="$OPTARG" ;;
+    r) revision="$OPTARG" ;;
+    *) exit 5 ;;
+  esac
+done
+# shift away args
+shift $(($OPTIND - 1))
+
+PACKAGE="$1"
+
+./trigger-source-rebuild -r "${revision:-1}" "$PACKAGE"
+echo "https://pgdgbuild.dus.dg-i.net/job/$PACKAGE-source"
+echo -n "Continue? "
+read reply
+./trigger-job ${distribution:+-d "$distribution"} "$PACKAGE-binaries"
index 4e52ac10761b3ff980e6cb6027fb70055bf3ad02..c9a5c19fcae08769dd048248f5b4c7963d02fb2d 100755 (executable)
@@ -9,7 +9,7 @@
 
 set -e
 
-while getopts "Aa:b:B:d:g:nq:u" opt ; do
+while getopts "Aa:b:B:d:g:nq:r:u" opt ; do
   case $opt in
     A) autopkgtest="autopkgtest=skip" ;;
     a) architecture="architecture==\"$OPTARG\"" ;;
@@ -20,6 +20,7 @@ while getopts "Aa:b:B:d:g:nq:u" opt ; do
     g) branch="branch=$OPTARG" ;;
     n) DEB_BUILD_OPTIONS="DEB_BUILD_OPTIONS=nocheck" ;;
     q) queue="queue=$OPTARG" ;;
+    r) revision="revision=$OPTARG" ;;
     u) upload="upload=extension-only" ;;
     *) exit 5 ;;
   esac
@@ -39,7 +40,7 @@ elif [ "$distribution" ]; then
 fi
 
 IFS="&"
-set -- $branch $binnmu_reason $binnmu_version $autopkgtest $DEB_BUILD_OPTIONS $queue $upload $matrix "$@" token=buildnow
+set -- $branch $revision $binnmu_reason $binnmu_version $autopkgtest $DEB_BUILD_OPTIONS $queue $upload $matrix "$@" token=buildnow
 
 set -x
 curl -f --netrc \
index 5634700c893f345ab0334e283bb8e5be6d617b2c..64070559aa4bcf133ff8f5a0734697c8c1e79c2b 100755 (executable)
@@ -8,10 +8,19 @@
 
 set -eu
 
+while getopts "r:" opt ; do
+  case $opt in
+    r) revision="$OPTARG" ;;
+    *) exit 5 ;;
+  esac
+done
+# shift away args
+shift $(($OPTIND - 1))
+
 PACKAGE="$1"
 XML=$(curl -fs https://pgdgbuild.dus.dg-i.net/view/Sources/job/$PACKAGE-source/lastSuccessfulBuild/api/xml?xpath=//lastBuiltRevision/SHA1)
 SHA1=$(echo "$XML" | grep -Eo '[0-9a-f]{40}')
 test "$SHA1"
 
 set -x
-./trigger-job "$PACKAGE-source" "branch=$SHA1"
+./trigger-job -r "${revision:-1}" "$PACKAGE-source" "branch=$SHA1"