From c9894ffcb6df066036eb714d4b2d6cc1db8b5ee7 Mon Sep 17 00:00:00 2001 From: badra001 Date: Thu, 6 Feb 2025 15:57:22 -0500 Subject: [PATCH] update to capture logs, make it work right --- local-app/git-xargs/add-gpg-keys.edl.sh | 25 +++++++++++++++---- .../git-xargs/submit.add-gpg-keys.edl.sh | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/local-app/git-xargs/add-gpg-keys.edl.sh b/local-app/git-xargs/add-gpg-keys.edl.sh index 9f4f0777..e30387dd 100755 --- a/local-app/git-xargs/add-gpg-keys.edl.sh +++ b/local-app/git-xargs/add-gpg-keys.edl.sh @@ -1,19 +1,34 @@ #!/bin/bash -LOGFILE="/tmp/git-xargs.$$.log" -USERS="hoad0300" +VERSION="1.0.4" +LOGFILE="/tmp/git-xargs.$XARGS_REPO_NAME.$$.log" +THIS=$(basname $0 .sh) +exec 3>&1 4>&2 +trap 'exec 2>&4 1>&3' 0 1 2 3 +exec 1>$LOGFILE 2>&1 + +USERS="house343 rudd0009 sung0005 vora0002" + +echo "* starting $THIS v$VERSION at $(date)" if [[ -d "init/git-secret" ]] && [[ -d ".gitsecret" ]] then git-secret reveal -f for u in $USERS do + echo "* copying user gpg key $u to init/git-secret/" cp $HOME/terraform/support/keys/gpg-public-keys/$u.gpg.asc init/git-secret/ - init/git-secret/setup-git-secret.sh $u +# bash init/git-secret/setup-git-secret.sh $u done - git-secret hide + echo "* adding users and running hide" + (cd init/git-secret; bash setup-git-secret.sh) + status=$? +# git-secret hide + echo "* whoknows" + git-secret whoknows fi -exit $? +echo "* ending $THIS v$VERSION at $(date) with status $status" +exit $status ## if [[ -d "init/git-secret" ]] && [[ -d ".gitsecret" ]] ## then diff --git a/local-app/git-xargs/submit.add-gpg-keys.edl.sh b/local-app/git-xargs/submit.add-gpg-keys.edl.sh index d92239e0..cd56c28f 100755 --- a/local-app/git-xargs/submit.add-gpg-keys.edl.sh +++ b/local-app/git-xargs/submit.add-gpg-keys.edl.sh @@ -1,7 +1,7 @@ GITHUB_HOSTNAME=github.e.it.census.gov GITHUB_OAUTH_TOKEN=ae2f950f5d628d665e6498bc699cdf24566bd94c git-xargs \ --branch-name master \ --skip-pull-requests \ - --commit-message '[xargs] add gpg hoad0300' \ + --commit-message '[xargs] add gpg for user users' \ --no-skip-ci \ --repos tf-repo.edl.txt \ "$(pwd)/add-gpg-keys.edl.sh" |& tee add-gpg-keys.edl.sh.$(date +%s).log