From 4b44a745e44069a517c3d5bb86d0fb39c088d838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Val=C3=AD=C4=8Dek=20=28YCNet=29?= Date: Fri, 23 Feb 2018 11:42:13 +0100 Subject: [PATCH] Oneshot make + notify-tag working --- Makefile | 8 ++++++-- checker/run-checker | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1d4b540..59002f5 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,17 @@ cloner: run: cloner docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) -run-once: cloner +once: cloner docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /usr/local/bin/cron-command -run-bash: cloner +bash: cloner docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /bin/bash # wizzard wizzard: cloner docker run -v $(GLOBALVOL):/data -it --rm $(TAGBASE) /usr/local/bin/wizzard +singleshot: cloner + docker run -v $(GLOBALVOL):/data -e BASE=/data/cloner-t456 --user executor -it --rm $(TAGBASE) run-checker + + diff --git a/checker/run-checker b/checker/run-checker index f4ba498..526932f 100755 --- a/checker/run-checker +++ b/checker/run-checker @@ -82,7 +82,7 @@ do fi done -# tags that changed or was pushed as new +# tags that changed or were pushed as new git --git-dir $repodir tag -l | while read tagname do [ -f $DET_TAGS/$tagname ] || touch $DET_TAGS/$tagname @@ -91,15 +91,24 @@ do if ! [ "$oldsha" = "$newsha" ] then # TAG_HASH = $newsha + # TAG_NAME = $tagname # TAG_AUTHOR - git --git-dir $repodir log $newsha -1 --pretty=format:"%an" + author=$(git --git-dir $repodir log $newsha -1 --pretty=format:"%an <%ae>") + # PROJECT_NAME = $cloner_project_name + # call the notify script + set +e + env TAG_HASH="$newsha" \ + TAG_NAME="$tagname" \ + TAG_AUTHOR="$author" \ + PROJECT_NAME="$cloner_project_name" \ + notify-tag + rc=$? + [ $rc -eq 0 ] || echo "Notify $tagname: return code = $rc" + set -e fi - done - - # save hash to keep things clear #detectorSumPersist $repodir