From 543979b0832442a28c039a3069569f5135d1f2ea Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Wed, 24 Jun 2020 22:33:09 +0200 Subject: [PATCH] checkupdates: use ssh deploy key closes fdroid/fdroiddata#2073 --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db9db7d001..466a609125 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,8 +105,15 @@ checkupdates_runner: - touch config.py - git config --global user.email "fdroidci@bubu1.eu" - git config --global user.name "F-Droid checkupdates bot" - - url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"` - - git remote set-url origin "https://gitlab-ci-token:${CI_GIT_PUSH_TOKEN}@${url_host}" + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - cp "${GITLAB_KNOWN_HOSTS}" ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - eval $(ssh-agent -s) + - echo "${CHECKUPDATES_SSH_DEPLOY_KEY}" | tr -d '\r' | ssh-add - + - url_host=$(echo "${CI_REPOSITORY_URL}" | sed -e 's|https\?://gitlab-ci-token:.*@|ssh://git@|g') + - echo "${url_host}" + - git remote set-url --push origin "${url_host}" script: - fdroid checkupdates --allow-dirty --auto --commit ${CHECKUPDATES_APPIDS} - git pull --rebase origin master