GitPull: add support for ssh cloned GitHub repositories (#241)

* disabled StrictHostKeyChecking during ssh key validation

* adds support to (ssh cloned) github repositories on key validation

* update Changelog and config.json
This commit is contained in:
Rubens Panfili
2018-02-06 14:06:56 +01:00
committed by Pascal Vizeli
parent f22b2f5709
commit 17576219dc
3 changed files with 8 additions and 5 deletions

View File

@@ -60,11 +60,11 @@ if [ -n "$DEPLOYMENT_KEY" ]; then
echo "Check SSH connection"
IFS=':' read -ra GIT_URL_PARTS <<< "$REPOSITORY"
# shellcheck disable=SC2029
if ! ssh -T -o "BatchMode=yes" "${GIT_URL_PARTS[0]}"
then
echo "Valid SSH connection for ${GIT_URL_PARTS[0]}"
DOMAIN="${GIT_URL_PARTS[0]}"
if OUTPUT_CHECK=$(ssh -T -o "StrictHostKeyChecking=no" -o "BatchMode=yes" "$DOMAIN" 2>&1) || ([[ $DOMAIN = *"@github.com"* ]] && [[ $OUTPUT_CHECK = *"You've successfully authenticated"* ]]); then
echo "Valid SSH connection for $DOMAIN"
else
echo "No valid SSH connection for ${GIT_URL_PARTS[0]}"
echo "No valid SSH connection for $DOMAIN"
add-ssh-key
fi
fi