Kovair DevOps and Any Git Integration Plugin

Any Git Plugin Details

Plugin Version: 1.0.0

Overview

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. This plug-in has been designed to manage any git based scm tool from Kovair DevOps platform.

Git Information:

More information can be found at Git. (as on 2021/03/26)

Version Supported:

This plugin was developed and tested against version git 2.31.0, version present on Git.(as on 2021/03/26)

Prerequisites

Git client should be downloaded and installed in client node(machine) and path variable of git client should be added into environment variable before perform any operation.

Plugin Operation:

1. CheckOutCode
This operation allows to check out code and pulls them in a local repository path;..

Input parameter(s):

Parameter Is Mandatory Help Text

Git Repository

true

URL of the repository to pull from, i.e. http://192.168.12.211:7990/scm/abc/xyz-repository.git; Note:If repository is private then username and password of private repository must be added to repository url, i.e.http://username:password@192.168.12.211:7990/scm/abc/xyz-repository.git;

Destination Directory

false

Indicate the path where the source tree will be created (can be relative to the job’s workspace) Ex: C:\Git\Demo. If user don’t give destination directory then a “Default” directory will be created under DevOps agent service folder.

Branch

false

Git branch name which branch you want to clone(that branch should present into that particular repository that you are cloning).

 

Output parameter(s):

Parameter Help Text

IsFilePresent

Is file downloaded.

GitStatus

Status of the operation.

 

Pass/Fail Condition:

Status Required string in outputlog

Passed

If files are physically present in the provided directory, output log is not empty, and doesn’t contains any of the following:

  1. ‘is not recognized as an internal or external command’
  2. ‘ERROR’
  3. ‘FullyQualifiedErrorId’
  4. ‘command not found’
  5. ‘No such file or directory’
  6. ‘already exists and is not an empty directory’
  7. ‘fatal’

Failed

If the output log is not empty and contains any of the following:

  1. ‘is not recognized as an internal or external command’
  2. ‘ERROR’
  3. ‘FullyQualifiedErrorId’
  4. ‘command not found’
  5. ‘No such file or directory’
  6. ‘already exists and is not an empty directory’
  7. ‘fatal’

 

2. ExecuteCommand

This operation allows to execute raw git command.

Input parameter(s):

Parameter Is Mandatory Help Text

Command

true

Raw git command to be executed.
Ex: git commit -m “MyFirstCommit”

Error Text

false

This field can be used to supply error text to search in console log after execution. If given text found in console log, overall task status will be error. To concat multiple error text use ‘||’ operator. Leading and trailing space will be trimmed before searching. i.e. Sample Error Text : Fatal || Error.

 

Output parameter(s):

Parameter Help Text

GitStatus

Status of the operation.

 

Pass/Fail Condition:

Status Required string in outputlog

Passed

If the outputlog is not empty, doesn’t contains any value of “Error Text” parameter and doesn’t contains any of the following:

  1. ‘is not recognized as an internal or external command’
  2. ‘ERROR’
  3. ‘FullyQualifiedErrorId’
  4. ‘command not found’
  5. ‘No such file or directory’
  6. ‘already exists and is not an empty directory’
  7. ‘fatal’

Failed

If the outputlog is not empty, contains any value of “Error Text” parameter or contains any of the following:

  1. ‘is not recognized as an internal or external command’
  2. ‘ERROR’
  3. ‘FullyQualifiedErrorId’
  4. ‘command not found’
  5. ‘No such file or directory’
  6. ‘already exists and is not an empty directory’
  7. ‘fatal’

 

Sample Commands

These are sample commands that can be tested through this plugin.

Sample Command(s):

Command Description Example

git config –global user.name “<Registered UserName>”
git config –global user.email “<Registered EmailId>”

To configure the git terminal first time.

git config –global user.name “xyz”
git config –global user.email “spal@xyz.com”

git clone <Path to your repository>

If you want to simply clone a repository then run this command in your terminal.

git clone http://192.168.12.211:7990/scm/abc/xyz-repository.git

cd existing-project
git init
git add –all
git commit -m “<Commit message>”
git remote add origin <Path to your repo>
git push -u origin HEAD:master

If you already have code ready to be pushed to this repository then run this in your terminal.

cd /d E:\Git
git init
git add –all
git commit -m “Initial Commit”
git remote add origin http://192.168.12.211:7990/scm/abc/xyz-repository.git
git push -u origin HEAD:master

cd existing-project
git remote set-url origin <Path to your repo>
git push -u origin –all
git push origin –tags

If your code is already tracked by Git and you have added some new files or you have made some changes in any file and you want to push it to your repo then use this command.

cd /d E:\Git
git remote set-url origin http://192.168.12.211:7990/scm/abc/xyz-repository.git
git push -u origin –all
git push origin –tags

cd existing project
git push origin master

To send changes to the master branch of your remote repository.

cd /d E:\Git
git push origin master

cd existing project
git status

To see list the files you’ve changed and those you still need to add or commit.

cd /d E:\Git
git status

cd existing project
git remote add origin <server>

If you haven’t connected your local repository to a remote server, run this command to add the server to be able to push to it

cd /d E:\Git
git remote add origin http://192.168.12.211:7990/scm/abc/xyz-repository.git

cd existing project
git remote -v

To see list of all currently configured remote repositories.

cd /d E:\Git
git remote -v

cd existing project
git checkout -b <branchname>

To create a new branch locally and switch to it.

cd /d E:\Git
git checkout -b project-xyz-Branch

cd existing project
git checkout <branchname>

To switch from one branch to another.

cd /d E:\Git
git checkout project-xyz-Branch

cd existing project
git branch

To get list of all the branches in your repo, and also tell you what branch you’re currently in.

cd /d E:\Git
git branch

cd existing project
git push origin <branchname>

To push the branch to your remote repository, so others can use it.

cd /d E:\Git
git push origin xyz-Branch

Disclaimers:

  1. Command other than git are also supported but are not recommended.

Release Details:

AnyGit: 1.0.0
2. Initial version with basic functionalities.

Contact us:

    Yes, I accept the Privacy Statement and want to receive latest information from Kovair.
    [tracking]