-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcircle.yml
More file actions
20 lines (18 loc) · 784 Bytes
/
Copy pathcircle.yml
File metadata and controls
20 lines (18 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
machine:
environment:
# Replace this URL with remote git server to mirror project.
GIT_MIRROR_URL: git@bitbucket.org:nicksantamaria/git-mirroring-circleci.git
test:
override:
# CircleCI requires at least 1 test command.
- "true"
deployment:
mirror_repo:
branch: /.*/
commands:
# Create a bare mirror clone of the Github repo.
- cd $HOME && git clone --mirror $CIRCLE_REPOSITORY_URL ${CIRCLE_PROJECT_REPONAME}_mirror
# Add custom git remote (called "mirror-remote".
- cd $HOME/${CIRCLE_PROJECT_REPONAME}_mirror && git remote add mirror-remote ${GIT_MIRROR_URL}
# Push to the new remote using --mirror flag.
- cd $HOME/${CIRCLE_PROJECT_REPONAME}_mirror && git push --mirror mirror-remote && git remote prune mirror-remote