synchronise GitLab repositories
Project description
[![Build Status](https://travis-ci.org/Code0x58/gitlab-sync.svg?branch=master)](https://travis-ci.org/Code0x58/gitlab-sync)
# gitlab-sync
This provides the gitlab-sync tool which clones GitLab and updates repositories.
## Config
You will need to have [SSH access configured for GitLab](https://docs.gitlab.com/ee/ssh/), and
have created a [personal access token](https://docs.gitlab.com/ee/api/#personal-access-tokens)
with API access.
The config goes in `~/.config/gitlab-sync.toml` or `~/.gitlab-sync.toml`,
which is [TOML](https://github.com/toml-lang/toml).
```toml
["~/gitlab"]
# get the gitlab access token from running a command
access-token = ["pass", "GitLab/api-access-token"]
# access-token = "plaintext token in file"
# paths to clone from GitLab, can include slashes for groups/projects
paths = [ "mintel", "obristow" ]
strategy = "mirror"
```
## Usage
```
$ gitlab-sync local-update
```
### Strategies
You have to define a strategy for each local copy you define in config, the
strategy defines what will happen when gitlab-sync runs over the given copy.
#### mirror
1. delete repositories which no longer exist remotely
2. move repositories which have been moved remotely
3. update local repositories
4. clean local repositories (prune+gc)
5. clone new repositories
This is good for having a local copy which you can use to perform searches
in using something like [`ag`](https://github.com/ggreer/the_silver_searcher).
The local copies should not be modified by users.
## To do
* flesh out integration tests
* cater for new repositories being made locally and pushed remotely
# gitlab-sync
This provides the gitlab-sync tool which clones GitLab and updates repositories.
## Config
You will need to have [SSH access configured for GitLab](https://docs.gitlab.com/ee/ssh/), and
have created a [personal access token](https://docs.gitlab.com/ee/api/#personal-access-tokens)
with API access.
The config goes in `~/.config/gitlab-sync.toml` or `~/.gitlab-sync.toml`,
which is [TOML](https://github.com/toml-lang/toml).
```toml
["~/gitlab"]
# get the gitlab access token from running a command
access-token = ["pass", "GitLab/api-access-token"]
# access-token = "plaintext token in file"
# paths to clone from GitLab, can include slashes for groups/projects
paths = [ "mintel", "obristow" ]
strategy = "mirror"
```
## Usage
```
$ gitlab-sync local-update
```
### Strategies
You have to define a strategy for each local copy you define in config, the
strategy defines what will happen when gitlab-sync runs over the given copy.
#### mirror
1. delete repositories which no longer exist remotely
2. move repositories which have been moved remotely
3. update local repositories
4. clean local repositories (prune+gc)
5. clone new repositories
This is good for having a local copy which you can use to perform searches
in using something like [`ag`](https://github.com/ggreer/the_silver_searcher).
The local copies should not be modified by users.
## To do
* flesh out integration tests
* cater for new repositories being made locally and pushed remotely
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gitlab-sync-0.2.3.tar.gz
(12.3 kB
view hashes)
Built Distribution
Close
Hashes for gitlab_sync-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2117cceaa42e43e03708b7915f955b0418639f032a0754fe5f7d67d909acd2a7 |
|
MD5 | 5d2edb23e0cfe0ebc38aea1ae8006cb1 |
|
BLAKE2b-256 | 06084478a69f93e2c3dd17d56376d222896ee6ea704de1e16cffcd79b3aedfc1 |