You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CI plugin to sync the contents of a git repository with another
@@ -19,14 +18,80 @@ docker run --rm \
19
18
-e PLUGIN_TARGET_BRANCH=test \
20
19
-v path/to/repo:/repo \
21
20
-w=/repo \
22
-
devatherock/drone-git-sync:latest
21
+
devatherock/git-sync:1.1.0
23
22
```
24
23
25
24
### CI
26
-
Please refer [docs](DOCS.md)
25
+
#### Config
26
+
The following parameters/secrets can be set to configure the plugin.
27
+
28
+
**Parameters**
29
+
***target_repo** - Git URI of target repository. If not specified, same as the source repo
30
+
***target_branch** - Branch to sync to, in target repository. Optional, defaults to master
31
+
***start_commit** - Commit sha of the first commit to sync. All commits after that will be synced. If not specified,
32
+
commit sha of the penultimate tag will be used. And if no tags are present, all commits up to the 100th will be synced
33
+
***debug** - Flag to enable debug logs. Optional, by default, debug logs are disabled
34
+
35
+
**Secrets**
36
+
37
+
The following secret values can be set to configure the plugin.
38
+
39
+
***GIT_SYNC_TOKEN** - Github API token with push access to the repository. Required if HTTP URI of target repository
40
+
is used
41
+
42
+
#### drone.io
43
+
44
+
```yaml
45
+
git-sync:
46
+
when:
47
+
ref: refs/tags/v*
48
+
event: tag
49
+
image: devatherock/git-sync:1.1.0
50
+
target_branch: prod
51
+
secrets: [ git_sync_token ]
52
+
```
53
+
54
+
#### vela
55
+
56
+
```yaml
57
+
steps:
58
+
- name: git-sync
59
+
ruleset:
60
+
tag: refs/tags/v*
61
+
event: tag
62
+
image: devatherock/git-sync:1.1.0
63
+
secrets: [ git_sync_token ]
64
+
parameters:
65
+
target_branch: prod
66
+
```
67
+
68
+
#### CircleCI
69
+
To add SSH key with write access to target repository, follow these [instructions](https://circleci.com/docs/2.0/add-ssh-key/)
70
+
71
+
```yaml
72
+
version: 2
73
+
jobs:
74
+
sync:
75
+
docker:
76
+
- image: devatherock/git-sync:1.1.0
77
+
working_directory: ~/my-source-repo
78
+
environment:
79
+
PLUGIN_TARGET_REPO: "[email protected]:xyz/my-target-repo.git"# Git URI of target repository. If not specified, same as the source repo
80
+
PLUGIN_TARGET_BRANCH: master # Branch to sync to in target repository. Optional, defaults to master
81
+
PLUGIN_START_COMMIT: 29186cd # Commit sha of the first commit to sync. All commits after that will be synced. If not specified, commit sha of the penultimate tag will be used. And if no tags are present, all commits up to the 100th will be synced
82
+
PLUGIN_DEBUG: false # Flag to enable debug logs. Optional, by default, debug logs are disabled
83
+
GIT_SYNC_TOKEN: xyz # Github API token with push access to the repository. Required if HTTP URI of target repository is used
84
+
steps:
85
+
- checkout
86
+
- add_ssh_keys:
87
+
fingerprints:
88
+
- "ssh key fingerprint"# Fingerprint of SSH key with write access to target repository
89
+
- run: sh /scripts/entry-point.sh
90
+
```
91
+
27
92
28
93
## Tests
29
-
To test the latest plugin images, run the below command
94
+
To test the latest plugin image, run the below command
0 commit comments