Skip to content

Commit

Permalink
Add mirror_github_to_gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jun 7, 2024
1 parent 9dd345b commit d9a0875
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ci-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -921,4 +921,21 @@ function test_downstream()
# }}}
# {{{ gitlab mirror
function mirror_github_to_gitlab()
{
mkdir ~/.ssh && echo -e "Host gitlab.tiker.net\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
eval $(ssh-agent) && echo "$GITLAB_AUTOPUSH_KEY" | ssh-add -
git fetch --unshallow
TGT_BRANCH="${GITHUB_REF#refs/heads/}"
echo "pushing to $TGT_BRANCH..."
TGT_REPO="git@gitlab.tiker.net:inducer/$(get_proj_name).git"
git push "$TGT_REPO" "$TGT_BRANCH"
git push "$TGT_REPO" --tags
}
# }}}
# vim: foldmethod=marker:sw=2

0 comments on commit d9a0875

Please sign in to comment.