https://github.com/wtsi-hgi/git-common-sync
A tool to synchronise common files between Git repositories
https://github.com/wtsi-hgi/git-common-sync
files git subrepos synchronise templates
Last synced: 10 months ago
JSON representation
A tool to synchronise common files between Git repositories
- Host: GitHub
- URL: https://github.com/wtsi-hgi/git-common-sync
- Owner: wtsi-hgi
- License: mit
- Created: 2017-06-20T17:31:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-06T14:59:40.000Z (almost 8 years ago)
- Last Synced: 2025-03-05T03:20:27.353Z (10 months ago)
- Topics: files, git, subrepos, synchronise, templates
- Language: Python
- Homepage:
- Size: 124 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-tools - git-common-sync - A tool to synchronise common files between Git repositories (Development / Time Series)
README
[](https://travis-ci.org/wtsi-hgi/git-common-sync)
[](https://codecov.io/gh/wtsi-hgi/git-common-sync)
[](https://badge.fury.io/py/gitcommonsync)
# Git Common Sync
_A tool to synchronise common files between Git repositories._
## Features
- Programmatically synchronises git repositories according to a specification.
- Supports synchronisation of:
- Files and directories.
- Directories managed by [git-subrepo](https://github.com/ingydotnet/git-subrepo).
- Content generated using templates and project specific values.
- Ansible support.
## How to use
### Prerequisites
- git >= 2.10.0
- git-subrepo >= 0.3.1
- python >= 3.6
- rsync >= 3.1.1
- ansible >= 2.4
### Installation
#### Ansible Module
```yaml
- gitcommonsync:
repository: http://www.example.com/repository.git
author_name: Ansible Synchroniser
author_email: team@example.com
key_file: /custom/id_rsa
files:
- src: /example/README.md
dest: README.md
overwrite: false
- src: /example/directory/
dest: config
templates:
- src: /example/ansible-groups.sh.j2
dest: ci/before_scripts.d/start.sh
variables:
message: "Hello world"
overwrite: true
subrepos:
- src: http://www.example.com/other-repository.git
dest: subrepos/other-repository
branch: master
overwrite: true
```
## Development
### Setup
Install both library dependencies and the dependencies needed for testing:
```bash
$ pip install -q -r requirements.txt
$ pip install -q -r test_requirements.txt
```
### Testing
To run the tests and generate a coverage report with unittest:
```bash
./test-runner.sh
```
If you wish to run the tests inside a Docker container (recommended), build `Docker.test`.
## Alternatives
- Powerful but complex Ruby based alternative from the Puppet community: https://github.com/voxpupuli/modulesync.