2011.08.11

How to try Antepedia Notifier on a git repository without playing with the central repository

Samuel Langlois
Posted by Samuel Langlois

The Antepedia Notifier is intended to be plugged onto your real production repository. But it's not always simple to convince your favorite sysadmin or/and project leader to install the Antepedia Notifier in your production environment just for test.

Or you might want to plug it on a forge where you cannot manage SCM hooks, such as github.

Here we will explain how to setup an alternative repository in order to try the Antepedia Notifier without touching your central git repository. And because one picture is better than a thousand words, here is the procedure:

 

Setup of an alternative git repository

The emplacement of your local development repository will be called $DEV_REPO. It's usually something like /path/to/my_project

$CENTRAL_REPO_URL will refer to your central git repository URL. It's usually something like git://url.to.your.repo/my_project.git

  • First create a bare clone of your central repository somewhere on your machine.

git clone --bare $CENTRAL_REPO_URL

This will create a directory <Name_of_your_repo>.git, the path of this repository will be referred as $LOCAL_BARE_REPO from now on. This repository will serve as a replacement for your central repository.

  • Now you can plug the Antepedia Notifier to this new repository. Installing the Antepedia Notifier is quite simple:
    • Register to get your authentication key
    • Download and unpack the archive AntepediaNotifier-x.x.zip
    • Create the following hook file $LOCAL_BARE_REPO/hooks/post-receive:

#!/bin/bash
/path/to/AntepediaNotifier-x.x/scripts/AntepediaNotifier4Git.sh

  • Adapt the /path/to/AntepediaNotifier-x.x/scripts/AntepediaNotifier.cfg file
  • Adapt the /path/to/AntepediaNotifier-x.x/notification.properties file to your configuration
  • Now you need to set this repository as a remote repository for your development repository.

cd $DEV_REPO
git remote add NotifierRepo $LOCAL_BARE_REPO

  • You can now push to your local bare repository, where the Antepedia Notifier is plugged.

git push NotifierRepo

And you're done!

Note that if you don't specify a remote repository to push, the changes will be pushed only to your central repository.

 

You might also want to push into both repositories every time you push. To do that you need to edit the configuration file of your developement repository (located in $DEV_REPO/.git/config) and add the following line under the line [remote "origin"]:

url = $LOCAL_BARE_REPO

Your config file should look like this by now:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = $CENTRAL_REPO_URL
    url = $LOCAL_BARE_REPO
[branch "master"]
    remote = origin
    merge = refs/heads/master

Now after each push, the Antepedia Notifier will analyze
every new commits and will notify you – by e-mail or by creating a JIRA ticket – if there are new open source components.

You are now able to test the Antepedia Notifier without modifying your central git repository and your production environment.

It's not too late to become a beta tester and enjoy it!

Stay informed on our latest news!