From 96bf5c84c2cf9f4c4c10c4a5c82bcd6dd11af943 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Sun, 12 Jul 2020 08:31:01 +0100 Subject: [PATCH] ci: utilize Gitlab's mirroring - https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html - Commits to protected branches are updated within a minute - Less one private key to manage --- .gitlab-ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 16ae194b..f1d31dd0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,6 @@ deploy_job: - 'which ssh-agent || (apk update && apk add curl openssh-client git grep)' - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - - echo "$GH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts @@ -38,12 +37,6 @@ deploy_job: - git remote set-url origin git@gitlab.com:curben/urlhaus-filter.git - git push origin master - # Push to mirror - # Force exit code 0 - - ssh -T git@github.com || ":" - - git remote add mirror git@github.com:curbengh/urlhaus-filter.git - - git push mirror master - rules: # Only trigger through schedule job in master branch - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"' @@ -64,7 +57,6 @@ failed_job: - 'which ssh-agent || (apk update && apk add curl openssh-client git grep)' - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - - echo "$GH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - chmod 700 ~/.ssh - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts @@ -82,9 +74,6 @@ failed_job: - ssh -T git@gitlab.com - git remote set-url origin git@gitlab.com:curben/urlhaus-filter.git - git push origin master - - ssh -T git@github.com || ":" - - git remote add mirror git@github.com:curbengh/urlhaus-filter.git - - git push mirror master rules: - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"'