Drone CI plugin for mirroring to external git repositories
10K+
The plugin is used for mirroring Git repositories to external ones and it has 2 modes:
Details on both of them are described below.
By default, this plugin will perform full mirroring. Please note, that the clone step should be disabled.
trigger:
event: [push, tag]
clone:
disable: true
steps:
- name: mirror
image: osshelp/drone-git-mirror
settings:
target_repo: [email protected]:OSSHelp/some-repo.git
ssh_key:
from_secret: git-mirror-private-key
This mode works similar to --mirror option for git-push. Technical details you can find here.
If the file named mirror_ignore_list exists, then the plugin will perform partial mirroring.
steps:
- name: mirror
image: osshelp/drone-git-mirror
settings:
target_repo: [email protected]:OSSHelp/some-repo.git
ssh_key:
from_secret: git-mirror-private-key
The content of mirror_ignore_list file should be compatible with --exclude-from option from rsync flag (GNU tar way).
| Param | Default | Description |
|---|---|---|
target_repo | - | SSH clone URL of target repo |
ssh_key | - | Private key with R/W permissions to use for interacting with target_repo. |
git_email | drone@osshelp | E-mail that will be used while pushing changes |
git_name | Drone CI | Name that will be used while pushing changes |
ignore_errors | false | If set to true the plugin will try to ignore all occurring errors to prevent build failing because of itself. |
mirror_ignore_list | .mirror_ignore | If this file is found in repo root - it contents will be used as excludement list for mirroring |
You need to create a file, named .mirror_ignore (if not overwritten with mirror_ignore_list variable) in the root directory of your repository. Describe wanted and unwanted files and directories inside as if you are preparing a file for using with --exclude-from option from rsync (GNU tar way).
For example:
.drone.yml
.mirror_ignore
file1.txt
dir1/*
dir2
Files, excluded with mirror_ignore_list will not be automatically removed from the remote repository. Neither do branches. No plans of implementing such functionality. Hence, you should do it manually.
Source repository is available at Github here.
GPL3
OSSHelp Team, see https://oss.help
Content type
Image
Digest
sha256:e8b00cad1…
Size
11.8 MB
Last updated
about 4 years ago
docker pull osshelp/drone-git-mirror