Tool to mirror repositories of a gitblit server
Project description
Scripts to make backup of gitblit
This package requires at least python 3.6.
Configuration file
A configuration-file is needed for listing and cloning repositories of a
gitblit server. Below is a template of a configuration file. Value of
parameters are written in {
and }
.
# Content of configuration.toml
# [authentication against http interface]
# username
user = "{user}"
# password
password = "your-secret-method"
# [server information]
# Web-interface base url. This is used to get information about repositories
source_web_url = "https://{host}.{domain}.{tld}/gitblit"
# The Base-URL to Remote-Server for git. This is used to construct the
# first argument of git clone
source_base_url = "ssh://{user}@{host}.{domain}.{tld}:{port}"
# [output]
# where to save the list of repositories
repositories_json = "/tmp/repos.json"
# where to clone repositories
backup_dir = "/tmp/backup"
# only clone these repos; clone all repositories in `repositories_json`
# if this parameter is empty or does not exist
included_repos = [
"awesome-project.git",
"games/nicegame.git",
"latex/codeanatomy.git"
]
List all Repositories: list-gitblit-repos configuration.toml
The command list-gitblit-repos
lists all repositories of Server configured by
variable [source_web_url]
. It expects one argument, which points to a configuration
file. Result is the file named in [repositories_json]
.
As an alternative, once can also use a browser to create a List of repositories:
- login with an (admin) account in Gitblit
- Open a Browser Console on the same session
- In the Console Prompt once can use the function
fetch()
like
var repos = {}; /* create a global variable, just for experiment */
fetch("https://{host}.{domain}.{tld}/gitblit/rpc/?req=LIST_REPOSITORIES")
.then(result => result.json()).then(json => repos = json)
to get list of repository.
- The list of repository can be found in network-Tab
Clone all Repository: clone-gitblit-repos configuration.toml
- Configuration parameters in
configuration.toml
can be reused or modified. - Call
clone-gitblit-repos configuration.toml
Restore repository to new server
Subject of change!
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
mirror-gitblit-0.1.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for mirror_gitblit-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e594843403e433832851e9f2686a7e5b74b4273ef9ac1a1ef261d55ee24ae962 |
|
MD5 | d67b0bcc06027dcf6f8cd743008a7478 |
|
BLAKE2b-256 | 7d68128e4df74aad26236fc2234614e7a42ea2666fd99df1f6ed3ada6af4cfc8 |