diff --git a/app.sh b/app.sh index ea18bf9..ee838dd 100644 --- a/app.sh +++ b/app.sh @@ -1,12 +1,10 @@ #!/bin/bash - GIT_REPO_PATH=$(mktemp -d) +GIT_REPO_PATH=$(mktemp -d) - git config --global user.email "$GIT_USER_MAIL" - git config --global user.name "$GIT_USERNAME" +git config --global user.email "$GIT_USER_MAIL" +git config --global user.name "$GIT_USERNAME" - echo "[INFO] clone repository..." - GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $GIT_REPO_DEPLOY_KEY" git clone "$GIT_REPO_URL" "$GIT_REPO_PATH" --quiet > /dev/null echo "[INFO] check variables..." if [ -z "$GIT_REPO_DEPLOY_KEY" ] ; then echo "[ERROR] \$GIT_REPO_DEPLOY_KEY is not set." @@ -41,7 +39,13 @@ if [ -z "$DEVICES" ] ; then exit 3 fi +echo "[INFO] clone repository..." +if GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $GIT_REPO_DEPLOY_KEY" git clone "$GIT_REPO_URL" "$GIT_REPO_PATH" --quiet > /dev/null; then cd "$GIT_REPO_PATH" || exit +else + echo "[ERROR] Failed to clone repository." + exit 1 +fi while true ; do echo "[INFO] pull repository..."