Git Trigger

Top  Previous  Next

The Git Trigger type allows you to monitor a Git source control repository and automatically start builds when changes are committed.

 

General information on creating triggers can be found under the Triggers Reference topic.

 

 

The Git Trigger Type contains the following options:

 

VersionControl_Git_Repository

 

Git only allows actions to be performed on a local repository, so you must specify a repository that is in a local or mapped network drive.

 

VersionControl_Git_Config

The Git executable location is the directory where Git is installed. Note, this is the directory that contains the bin directory, not the bin directory itself.

 

The Git trigger uses the commit hash as the version number. By default, the abbreviated commit hash is used. The Long version number option allows you to instead use the full commit hash.

 

Monitoring a remote repository

Git does not allow the 'log' command to be run on remote repositories, so they cannot be monitored directly. The easiest solution is to map a network drive to the server that contains the repository. If that is not possible you can create a local clone of the remote repository on the server where FinalBuilder Server resides.

 

The Git trigger can update this local clone from a remote repository before checking for changes, ensuring the trigger is working on the most recent version of the repository.

 

To do this, tick the "Update from remote repository" checkbox, specify the remote repository location and the branch to pull from. The repository location can be any valid Git URL, for example:

i:\data\git\TestProj
git@github.com:<username>/TestProj.git
git://github.com/<username>/TestProj.git
http://github.com/<username>/TestProj.git

 

All that is required is that the user FinalBuilder Server is running as has read access to the repository.

 

Using SSH

If you have a private Git repository you can authenticate via SSH. To set this up:

log into the FinalBuilder Server host server as the user that FinalBuilder Server runs as
Use ssh-keygen to create an SSH key pair without a password. The keys will be created in %USERPROFILE%/.ssh/
Add the generated public key to the remote Git server
Test that you can pull from the remote repository via the git command line tools

 

NB Because FinalBuilder Server is non-interactive, you cannot password protect the private key.

 

Exclude Files From Monitoring

 

See Excluding Files From Source Control Monitoring.