check if clone was successful
This commit is contained in:
parent
2094cd7567
commit
7107e3d999
1 changed files with 9 additions and 5 deletions
8
app.sh
8
app.sh
|
@ -5,8 +5,6 @@
|
||||||
git config --global user.email "$GIT_USER_MAIL"
|
git config --global user.email "$GIT_USER_MAIL"
|
||||||
git config --global user.name "$GIT_USERNAME"
|
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..."
|
echo "[INFO] check variables..."
|
||||||
if [ -z "$GIT_REPO_DEPLOY_KEY" ] ; then
|
if [ -z "$GIT_REPO_DEPLOY_KEY" ] ; then
|
||||||
echo "[ERROR] \$GIT_REPO_DEPLOY_KEY is not set."
|
echo "[ERROR] \$GIT_REPO_DEPLOY_KEY is not set."
|
||||||
|
@ -41,7 +39,13 @@ if [ -z "$DEVICES" ] ; then
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
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
|
cd "$GIT_REPO_PATH" || exit
|
||||||
|
else
|
||||||
|
echo "[ERROR] Failed to clone repository."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
while true ; do
|
while true ; do
|
||||||
echo "[INFO] pull repository..."
|
echo "[INFO] pull repository..."
|
||||||
|
|
Loading…
Reference in a new issue