flock against concurrent reprepro operations
authorChristoph Berg <christoph.berg@credativ.de>
Wed, 7 Oct 2015 08:48:41 +0000 (10:48 +0200)
committerChristoph Berg <christoph.berg@credativ.de>
Wed, 7 Oct 2015 08:48:41 +0000 (10:48 +0200)
jenkins/pgapt-jobs.yaml
repo/processincoming
repo/promote

index ea1359417e59af241e325e5f5c9a7c6986e766ba..78c780c872192ba7ed0471ef8cc9a22b72636b6d 100644 (file)
                         which-build: upstream-build
                         fallback-to-last-successful: true
                 - shell: 'dput-pgdg $queue'
+        publishers:
+                - ircbot:
+                        matrix-notifier: only-parent
+                        message-type: summary-params
+                - groovy-postbuild: 'manager.addShortText("${manager.build.environment.binaries} (${manager.build.environment.queue})")'
 
 #- job:
 #        name: promote
index 27d58ce8724c3f4feee2b76a0580bd7e15a3c1cb..650d81d77debfa73fbab7dcd58cbd35d0cbf2218 100755 (executable)
@@ -4,4 +4,5 @@ QUEUE="${1:-incoming}"
 [ "$QUEUE" = "incoming" ] || exit 0
 REPREPRO_BASE_DIR="/srv/apt/repo"
 
+flock "$REPREPRO_BASE_DIR/db/.lock" \
 /usr/bin/reprepro -b "$REPREPRO_BASE_DIR" --morguedir "$REPREPRO_BASE_DIR/morgue" --verbose processincoming pgdg
index c0a1621cd499d7fc5f91de2b942b31773087f206..a7f7a8aa553a843391a53c30248ee07cdc893087 100755 (executable)
@@ -6,7 +6,7 @@ set -eu
 
 [ "$USER" = "aptuser" ] || SUDO="sudo -u aptuser"
 export REPREPRO_BASE_DIR="/srv/apt/repo"
-REPREPRO="reprepro -b $REPREPRO_BASE_DIR --morguedir $REPREPRO_BASE_DIR/morgue --verbose"
+REPREPRO="flock $REPREPRO_BASE_DIR/db/.lock /usr/bin/reprepro -b $REPREPRO_BASE_DIR --morguedir $REPREPRO_BASE_DIR/morgue --verbose"
 DISTS="all"
 
 if [ "${DEBUG:-}" ]; then