diff options
author | Chris Evich <cevich@redhat.com> | 2019-09-20 11:49:07 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2019-09-20 14:03:54 -0400 |
commit | 33b3d2914f1f8a76751ccd5aa873fc4e7b05f344 (patch) | |
tree | 87e2db9603ae6d8028a5692373ffecf94c1aa161 /contrib/cirrus/success.sh | |
parent | 66f4bc76384cca8716f9192aa279138cb2b35812 (diff) | |
download | podman-33b3d2914f1f8a76751ccd5aa873fc4e7b05f344.tar.gz podman-33b3d2914f1f8a76751ccd5aa873fc4e7b05f344.tar.bz2 podman-33b3d2914f1f8a76751ccd5aa873fc4e7b05f344.zip |
Cirrus: More podbot/success improvements
* Fix one disused and two missing required env. vars.
* Slightly optomize processing of commit-author names
* Fix problem of printing duplicate author names when there are multiple
commits.
* Fix bot's IRC connection timeout too short.
* Add a single retry of IRC connection after 5-second delay.
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/success.sh')
-rwxr-xr-x | contrib/cirrus/success.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/cirrus/success.sh b/contrib/cirrus/success.sh index 8a9618b91..3b171757f 100755 --- a/contrib/cirrus/success.sh +++ b/contrib/cirrus/success.sh @@ -4,7 +4,7 @@ set -e source $(dirname $0)/lib.sh -req_env_var CIRRUS_BRANCH CIRRUS_BUILD_ID CIRRUS_REPO_FULL_NAME CIRRUS_BASE_SHA CIRRUS_CHANGE_IN_REPO +req_env_var CIRRUS_BRANCH CIRRUS_REPO_FULL_NAME CIRRUS_BASE_SHA CIRRUS_CHANGE_IN_REPO CIRRUS_CHANGE_MESSAGE cd $CIRRUS_WORKING_DIR @@ -25,9 +25,9 @@ then # newline separated GITLOG="git log --format='%ae'" COMMIT_AUTHORS=$($GITLOG $SHARANGE || $GITLOG -1 HEAD | \ - sort -u | \ - egrep -v "$EXCLUDE_RE" | \ tr --delete --complement "$EMAILCSET[:space:]" | \ + egrep -v "$EXCLUDE_RE" | \ + sort -u | \ tail -$MAX_NICKS) for c_email in $COMMIT_AUTHORS @@ -43,8 +43,13 @@ then echo -e "\t\tNot found in $(basename $AUTHOR_NICKS_FILEPATH), using e-mail username." NICK=$(echo "$c_email" | cut -d '@' -f 1) fi - echo -e "\tUsing nick $NICK" - NICKS="${NICKS:+$NICKS, }$NICK" + if ! echo "$NICKS" | grep -q "$NICK" + then + echo -e "\tUsing nick $NICK" + NICKS="${NICKS:+$NICKS, }$NICK" + else + echo -e "\tNot re-adding duplicate nick $NICK" + fi done fi |