Kovair DevOps and Bitbucket Integration Plugin

Bitbucket Plugin Details

Plugin Version: 1.0.0

Overview

Bitbucket is a Git repository management solution designed for professional teams. It gives you a central place to manage git repositories, collaborate on your source code and guide you through the development flow. Bitbucket Cloud is a Git based code hosting and collaboration tool, built for teams. Bitbucket’s best-in-class Jira and Trello integrations are designed to bring the entire software team together to execute on a project. Bitbucket provides one place for your team to collaborate on code from concept to Cloud, build quality code through automated testing, and deploy code with confidence. This plug-in has been designed to manage Bitbucket On-Premise tool from Kovair DevOps platform.

Bitbucket Information:

More information can be found at Bitbucket . (as on 2021/02/18)

Version Supported:

This plugin was developed and tested against bitbucket on-premise server and git client.

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

Bitbucket 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:\Bitbucket\Demo. If user don’t give destination directory then a “Default” directory will be created under DevOps agent service folder.

Branch

false

Bitbucket 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.

BitbucketStatus

Final CheckOutCode Status.

 

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 or any bitbucket specific command.

Input parameter(s):

Parameter Is Mandatory Help Text

Base URL

true

Provide the base URL of Boomi instance.

Command

true

Raw git command or any bitbucket 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

BitbucketStatus

Final ExecuteCommand Status.

 

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:\Bitbucket
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:\Bitbucket
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:\Bitbucket
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:\Bitbucket
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:\Bitbucket
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:\Bitbucket
git remote -v

cd existing project
git checkout -b <branchname>

To create a new branch locally and switch to it.

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

cd existing project
git checkout <branchname>

To switch from one branch to another.

cd /d E:\Bitbucket
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:\Bitbucket
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:\Bitbucket
git push origin xyz-Branch

Disclaimers:

  1. 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.

Release Details:

Bitbucket: 1.0.0
Initial version with basic functionalities.

Contact us:

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