Fix REMOTE HOST in new clone for host in ssh config check

This commit is contained in:
2026-01-09 14:07:30 +09:00
parent 4fc2c7f009
commit 1b4e9c7c77

View File

@@ -122,7 +122,7 @@ else
fi; fi;
# set remote host if not set to the ssh config name # set remote host if not set to the ssh config name
if [ -z "${REMOTE_HOST}" ]; then if [ -z "${REMOTE_HOST}" ]; then
REMOTE_HOST="${GIT_REPOSITORY_NAME}"; REMOTE_HOST="$(basename "${REPOSITORY}" .git)";
fi; fi;
if [ $error -eq 1 ]; then if [ $error -eq 1 ]; then
exit; exit;
@@ -131,7 +131,7 @@ fi;
error=0 error=0
echo "* Validate SSH PEM Key exist and SSH config"; echo "* Validate SSH PEM Key exist and SSH config";
if ! grep "Host ${REMOTE_HOST}" "${GIT_WEBHOOK_BASE_FOLDER}"/.ssh/config; then if ! grep "Host ${REMOTE_HOST}" "${GIT_WEBHOOK_BASE_FOLDER}"/.ssh/config; then
echo "[!] ssh config entry for Host ${REMOTE_HOST} is missing"; echo "[!] ssh config entry for Host ${REMOTE_HOST} is missing in ${GIT_WEBHOOK_BASE_FOLDER}/.ssh/config";
error=1; error=1;
else else
# make sure the identiy file is there # make sure the identiy file is there