From 41cee6f45918aa0c677e42a7a95b40a5f9257a26 Mon Sep 17 00:00:00 2001 From: bel Date: Sat, 14 Oct 2023 20:30:59 -0600 Subject: [PATCH] noninteractive and not home killing --- deploy.firebase.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/deploy.firebase.sh b/deploy.firebase.sh index a64a771..38cf12b 100755 --- a/deploy.firebase.sh +++ b/deploy.firebase.sh @@ -30,16 +30,18 @@ cd $outdir ( set -ueo pipefail - if ! tty; then - printf "https://gitlab%40breel.dev:%s@gitlab.com\n" "$GITLAB_PAT" > "$HOME/.git-credentials" + if [ -n "$GITLAB_PAT" ]; then + export HOME="$(mktemp -d)" + git clone https://gitlab%40breel.dev:"$GITLAB_PAT"@gitlab.com/breel/resume.git gitlab-resume.d + git config --global user.name "gitlab@breel.dev" + git config --global user.email "gitlab@breel.dev" + rm -rf ./gitlab-resume.d/* + cp -r ./public/* ./gitlab-resume.d/ + cd ./gitlab-resume.d/ + git add -A :/ + git commit -m "$(date -u +%Y-%m-%dT%H:%M:%S)" + git push origin main fi - git clone https://gitlab.com/breel/resume.git gitlab-resume.d - rm -rf ./gitlab-resume.d/* - cp -r ./public/* ./gitlab-resume.d/ - cd ./gitlab-resume.d/ - git add -A :/ - git commit -m "$(date -u +%Y-%m-%dT%H:%M:%S)" - git push origin main ) || true (