From 2a083fe8eb2026479ddb0792d088ca82cf3d54a0 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 16 Oct 2019 11:19:51 +0200 Subject: [PATCH 1/3] Do not have default args that never apply --- deploy/services-demo/create_team_members.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/services-demo/create_team_members.sh b/deploy/services-demo/create_team_members.sh index c899f8098cc..e52a8b0c567 100755 --- a/deploy/services-demo/create_team_members.sh +++ b/deploy/services-demo/create_team_members.sh @@ -2,10 +2,10 @@ set -e -ADMIN_UUID="a09e9521-e14e-4285-ad71-47caa97f4a16" -TEAM_UUID="9e57a378-0dca-468f-9661-7872f5f1c910" -BRIG_HOST="http://localhost:8082" -CSV_FILE="myfile.csv" +ADMIN_UUID="n/a" +TEAM_UUID="n/a" +BRIG_HOST="http://localhost:8080" +CSV_FILE="n/a" USAGE=" This bash script can be used to invite members to a given team. Input From 0f8e61f5628f03b3cf70f140343c2983b407f1e5 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 16 Oct 2019 11:20:28 +0200 Subject: [PATCH 2/3] Make errors more greppable, do not abort on first error --- deploy/services-demo/create_team_members.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy/services-demo/create_team_members.sh b/deploy/services-demo/create_team_members.sh index e52a8b0c567..e6a6cc09e60 100755 --- a/deploy/services-demo/create_team_members.sh +++ b/deploy/services-demo/create_team_members.sh @@ -73,8 +73,7 @@ do if ( ( echo "$INVITATION_ID" | grep -q '"code"' ) && ( echo "$INVITATION_ID" | grep -q '"label"' ) ) ; then - echo "Got an error, aborting: $INVITATION_ID" - exit 1 + echo "failed inviting $USER_NAME <$EMAIL>: $INVITATION_ID" fi echo "Sleeping 1 second..." 1>&2 From 6533fdbccef30e2103dccdf4d48cfb952f73e9e3 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Wed, 16 Oct 2019 11:20:43 +0200 Subject: [PATCH 3/3] Usage info --- deploy/services-demo/create_team_members.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/services-demo/create_team_members.sh b/deploy/services-demo/create_team_members.sh index e6a6cc09e60..c0fabeafe51 100755 --- a/deploy/services-demo/create_team_members.sh +++ b/deploy/services-demo/create_team_members.sh @@ -19,6 +19,17 @@ USAGE: $0 -t : ID of the inviting team. default: ${TEAM_UUID} -h : Base URI of brig. default: ${BRIG_HOST} -c : file containing info on the invitees in format 'Email,UserName'. default: ${CSV_FILE} + +If you tee(1) stdout, stderr of this script into a log file, you can +grep that log file for errors like this: + +$ grep code out.log | grep email-exists # the most common case +$ grep code out.log | grep -v email-exists + +If you are in a hurry, you may want to change the sleep(1) at the end +of the invite loop to less than a second. If you want to give up on +the first error, add an exit(1) where we check the $INVIDATION_ID. + " # Option parsing: