This is an old revision of the document!
I decided to check whether it would be feasible to host our own git repositories under control of gitolite.
In comparison with github option, it would
give us full control over our repository. Also github does provide only post-receive hooks. Therefore some tasks are difficult. For example restricting who can delete
auto-xxx tags is problematic.
To enable for other developers to test how the PLD repository would look like after migration to git, I have created a mock setup on carme. It contains all packages present in PLD and should be quite up to date. The path to access the repository is:
All packages are in packages directory. For example to obtain glibc:
git clone email@example.com:packages/glibc
Authentication is based on ssh keys. People whose keys are in SSH-keys in PLD repository should have access.
<dist>builders can write
@admins = draenog @th-builders = builderth @ac-builders = builderac @builders = @th-builders @ac-builders repo gitolite-admin RW+ = @admins repo testing RW+ = @all repo packages/..* C = @all RW refs/tags/auto-th = @th-builders RW refs/tags/auto-ac = @ac-builders - refs/tags/auto- = @all - = @builders RW master$ = @all - master$ = @all RW+ = @all
In upstream version of gitolite, new package is created by cloning of no existing repo (if the access rules allow for it). However I think that it is too error prone. So gitolite was forked and an option to disable creation of wildcard repositories was added. Instead an admin defined command was created for this task:
ssh firstname.lastname@example.org create <new_repo>
People with write access to gitolite-admin repository can use admin defined command to move obsoleted packages to attic space:
ssh email@example.com trash <repo>
It is possible to prevent the commits of large files or archives. Currently every file must pass the following tests:
Post-receive hook can be used to send email notifications about any changes in repositories. The example script can be found in git repository.
The example email:
Subject: [SCM] packages/a branch master created. a575a0acd8e7d9fdfdffbfe3f78b5f33cc819f7a This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "packages/a". The branch, master has been created at a575a0acd8e7d9fdfdffbfe3f78b5f33cc819f7a (commit) - Log ----------------------------------------------------------------- commit a575a0acd8e7d9fdfdffbfe3f78b5f33cc819f7a Author: Kacper Kornet <firstname.lastname@example.org> Date: Thu May 26 16:19:28 2011 +0100 Second commit diff --git a/f b/f index 7898192..422c2b7 100644 --- a/f +++ b/f @@ -1 +1,2 @@ a +b commit 3a9172e6deb87fa536a356e2a703d334e63cb6dd Author: Kacper Kornet <email@example.com> Date: Thu May 26 16:19:13 2011 +0100 First commit diff --git a/f b/f new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/f @@ -0,0 +1 @@ +a ----------------------------------------------------------------------- hooks/post-receive -- packages/a
Git daemon provides an anonymous, read-only access to repositories. For example:
git clone git://carme.pld-linux.org/packages/glibc
At http://github.com/draenog/rpm-build-tools is a modified builder script. On
gitolite branch there is a version that works with the gitolite repo on carme. To download it:
git clone -b gitolite git://github.com/draenog/PLDbuilder
To reduce the amount of downloaded data it is possible to make a shallow copy of repository with truncated history:
git clone --depth <n> firstname.lastname@example.org:packages/kernel
builder.sh --depth <n> -g kernel
slug.py init name
slug.py clone pattern
slug.py update -n pattern
If pattern is omitted, it fetches all repositories known to the upstream
slug.py update pattern
You can also use 'git pld' prefix to call the commands. For example:
git pld clone
Description of more advanced options can be obtained by:
slug.py <command> --help
Only source builder needs to be modified. The changes are minimal so it would be possible to adapt the existing builder with small effort. The modified version of PLD builder automation can be found at https://github.com/draenog/pld-builder.new
In case of any problem, please contact email@example.com