[ARVADOS-DEV] updated: f4d018c979b333d61fed9b1884d7edab540f3c1a
git at public.curoverse.com
git at public.curoverse.com
Thu Oct 15 08:15:00 EDT 2015
Summary of changes:
jenkins/run-deploy.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
discards d4d09f8e0174a91552f29031493592cfe40e993a (commit)
discards 9d43ab88e37dcdb5053ce552a398a34ba9c9224f (commit)
via f4d018c979b333d61fed9b1884d7edab540f3c1a (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (d4d09f8e0174a91552f29031493592cfe40e993a)
\
N -- N -- N (f4d018c979b333d61fed9b1884d7edab540f3c1a)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit f4d018c979b333d61fed9b1884d7edab540f3c1a
Author: Brett Smith <brett at curoverse.com>
Date: Wed Oct 14 18:18:58 2015 -0400
7341: run-deploy.sh retries failed Puppet agent runs.
It simply keeps retrying any failure until ten minutes have passed,
per Nico's suggestion in the comments.
Bonus bugfix: make sure run_puppet's ECODE variable gets set to the
exit status of Puppet (or the wrapper script), and not tee.
diff --git a/jenkins/run-deploy.sh b/jenkins/run-deploy.sh
index 4953659..b81218e 100755
--- a/jenkins/run-deploy.sh
+++ b/jenkins/run-deploy.sh
@@ -64,6 +64,21 @@ EXITCODE=0
COLUMNS=80
+PUPPET_AGENT='
+now() { date +%s; }
+let endtime="$(now) + 600"
+while [ "$endtime" -gt "$(now)" ]; do
+ puppet agent --test --detailed-exitcodes
+ agent_exitcode=$?
+ if [ 0 = "$agent_exitcode" ] || [ 2 = "$agent_exitcode" ]; then
+ break
+ else
+ sleep 10s
+ fi
+done
+exit ${agent_exitcode:-99}
+'
+
title () {
date=`date +'%Y-%m-%d %H:%M:%S'`
printf "$date $1\n"
@@ -76,12 +91,12 @@ function run_puppet() {
title "Running puppet on $node"
TMP_FILE=`mktemp`
if [[ "$DEBUG" != "0" ]]; then
- ssh -t -p2222 -o "StrictHostKeyChecking no" -o "ConnectTimeout 5" root@$node -C "/usr/bin/puppet agent -t" | tee $TMP_FILE
+ ssh -t -p2222 -o "StrictHostKeyChecking no" -o "ConnectTimeout 5" root@$node -C bash -c "'$PUPPET_AGENT'" | tee $TMP_FILE
else
- ssh -t -p2222 -o "StrictHostKeyChecking no" -o "ConnectTimeout 5" root@$node -C "/usr/bin/puppet agent -t" > $TMP_FILE 2>&1
+ ssh -t -p2222 -o "StrictHostKeyChecking no" -o "ConnectTimeout 5" root@$node -C bash -c "'$PUPPET_AGENT'" > $TMP_FILE 2>&1
fi
- ECODE=$?
+ ECODE=${PIPESTATUS[0]}
RESULT=$(cat $TMP_FILE)
if [[ "$ECODE" != "255" && ! ("$RESULT" =~ 'already in progress') && "$ECODE" != "2" && "$ECODE" != "0" ]]; then
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list