From a375587747fe98d9ef33fc57349e1edc51d112ac Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Tue, 25 Sep 2018 21:24:05 +0200 Subject: [PATCH] Use https for curl, reset repo in a nicer way --- Gitlab-hook-script.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gitlab-hook-script.md b/Gitlab-hook-script.md index cb54215..14b279d 100644 --- a/Gitlab-hook-script.md +++ b/Gitlab-hook-script.md @@ -27,7 +27,7 @@ deploy_challenge() { git -C "$REPO" commit -m "Let's Encrypt challenge" git -C "$REPO" push sleep 20 - while ! curl --output /dev/null --silent --head --fail "http://$DOMAIN/.well-known/acme-challenge/$TOKEN_FILENAME"; do + while ! curl --output /dev/null --silent --head --fail "https://$DOMAIN/.well-known/acme-challenge/$TOKEN_FILENAME"; do echo sleeping sleep 5 done @@ -35,7 +35,8 @@ deploy_challenge() { clean_challenge() { TOKEN_FILENAME="$2" - git -C "$REPO" reset --hard HEAD~ + git -C "$REPO" reset HEAD~ + rm -r "$REPO/public/" git -C "$REPO" push --force-with-lease }