diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c053799dec44ed39e9c01e3d6bdbc6c72b121c07..6503922726229b4d697894deef9a4226397753b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,7 +57,7 @@ sync: variables: - $GIT_PUSH_URL =~ /^\S+$/ && ($GIT_PUSH_PASSWORD =~ /^\S+$/ || $SSH_PULL_PRIVATE_KEY=~ /^\S+$/) && $GIT_PULL_URL =~ /^\S+$/ before_script: - - git config --global credential.helper store && touch ~/.git-credentials + - rm -f ~/.git-credentials || true; git config --global credential.helper store && touch ~/.git-credentials - test -n "${GIT_PULL_PASSWORD}" && echo "https://${GIT_PULL_LOGIN:-oauth2}:${GIT_PULL_PASSWORD}@$(echo ${GIT_PULL_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - test -n "${GIT_PUSH_PASSWORD}" && echo "https://${GIT_PUSH_LOGIN:-oauth2}:${GIT_PUSH_PASSWORD}@$(echo ${GIT_PUSH_URL} | sed -r 's#([^/])/[^/].*#\1#' | sed -e 's|https://||g')" >> ~/.git-credentials || true - ( eval $(ssh-agent -s); echo "${SSH_PULL_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null && mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config ) || true