Skip to main content

A tool to synchronise common files between Git repositories

Project description

Build Status codecov PyPI version

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.
    • 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

Installation

Ansible Module

- gitcommonsync:
    repository: http://www.example.com/repository.git
    committer_name: Ansible Synchroniser
    committer_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:

$ 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:

./test-runner.sh

If you wish to run the tests inside a Docker container (recommended), build Docker.test.

Alternatives

License

MIT license.

Copyright (c) 2017 Genome Research Limited

Project details


Release history Release notifications

History Node

2.0.0

This version
History Node

1.2.0

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
gitcommonsync-1.2.0.tar.gz (15.8 kB) Copy SHA256 hash SHA256 Source None Jul 20, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page