GitRunner

GitRunner is a plugin for JIRA that allows you to clone your GIT repositories into a folder within the JIRA home directory.
In the initial version the destination folder is <jira_home>/scripts so if you use a plugin like ScriptRunner your scripts will be automatically indexed and available for use.

WARNING: removing the plugin also removes all repositories associated with GitRunner and listed in the Repository List page and saved in the <jira_home> / scripts folder. So, before removing the plugin, make a backup or download the compressed file containing the repositories. Remember that it is still cloned repositories and you can restore them with other tools at any time.

The plugin have a READ ONLY interaction with your GIT remote repository: only clone, pull and fetch operation was enabled.

Only users with admin permission can use this plugin.

Repository List

The first screen shows the list of repositories that you have created. The NOT CLONED icon show that no folder was created yet: the only record created was one record in the plugin table with the repository properties. Only the CLONE action in the MANAGE section create the folder and clone the remote repository.

At the top you have three features:

 

It allows you to add a new repository

 

It allows you to download the entire contents of the cloned repositories with GitRunner in a compressed file

 

It allows to make a backup of the cloned repositories with GitRunner in the <jira_home> / export folder in a compressed file

 

Once you have added your first repository the saved information will be displayed and you can use the "manage" button to clone the repository that will be placed in the folder you specified.

Only after having cloned the repository will you have the "fast pull" function which will update the repository using the current branch selected.

You can also edit the single repository after creation.

 You can delete the repository. This action remove the record in the plugin table and all the files in the specific repository folder.


Add Repository

In this you can enter the URL of your GIT repository using one of the following protocols: HTTP, HTTPS, GIT
You will have the possibility to select the type of authentication you use on your git server from the following options:

  • No password

  • User and Password

  • SSH key

In case you choose SSH the plugin will generate a public SSH-RSA key that you will need to add to your server.

 


Edit Repository

From the repository list screen you can edit the single repository if you need to change user, password, url or authentication method BUT NOT THE DESTINATION FOLDER.


Manage Repository

Once saved, the repository must be cloned as first operation.

If you have chosen SSH authentication, the public key to be added (before clone) to your remote repository will be displayed.


Once cloned, a screen divided into three parts will appear:

  • Public key (only if SSH-RSA authentication is chosen)

  • List of local and remote branches

  • List of local and remote commits (last 5 commits per branch)

You have some repository-level actions available:

With Fetch Remote you can download changes made to the remote repository as new commits or new branches available.

With Generate KeyPair you can regenerate the SSH key

With Reset Local delete all the contents of the repository on disk and you will return to the pre-cloning situation

 

After clone the master branch was set as current active branch

In the branches part there's 2 tabs:

  • Local branches

  • Remote branches

Il the branches in the local branches list was excluded from remote branches and viceversa


Branches

Local Branches

The local branches tab allows you to perform some operations on the branches that have already been checked out:

You can update the branch by downloading the latest remote changes

 You can checkout on the branch and make it the current branch

You can delete the local branch

If deletion is not allowed due to alignment problems with the remote branch following merge or other operations, it is possible to force cancellation of the local branch

 

Remote branches

The remote branches tab allows you to perform some operations on the remote branches that have not yet checked out:

You can perform a create and checkout branch from remote repository.

WARNING: the branch was set IMMEDIATLY as current branch in the local repository

 


Commits

Local commit and Remote commit is a list of the last 5 commit by branch. You can update the list with Fetch button on top right of this screen.