FlexDeploy - Git Plugin Guide

The FlexDeploy Git plugin makes it easy to interact with source code stored in a Git repository. This plugin requires a Git client to be stored on the FlexDeploy server and any endpoints which will execute Git plugin operations. FlexDeploy allows users to configure Git repository connection details to be shared by various projects and other configurations at a project level.  This allows workflows to perform clone and tag operations within a workflow.

  • Create SCM Instance for Git and define URL, User and Password information. You can also validate connection when creating SCM Instance for Git.

  • At project level, select Git as SCM Type and provide details like Branch, Sparse Folders, Tag etc. which are defined as Groovy scripts.

See Using SSH protocol with GitHub to setup SSH connectivity to GitHub.

See Using SSH protocol with Bitbucket to setup SSH connectivity to Bitbucket.

Supported Versions

  • 1.7.9+

Key Features

  • Executes native commands using Git client

  • Supports partial and shallow checkouts from Git Repository

Target Group Properties

Property Name

Required

Description

Property Name

Required

Description

FDGIT_URL

Yes

The URL to the remote GIT repository.

FDGIT_USER

Yes

The username to the remote GIT repository.

FDGIT_PASSWORD

Yes

The password for FDGIT_USER.

FDGIT_CMD_PATH

No

The GIT executable folder.
Note: If the Git executable is on the PATH, then there is no need to setup this property, otherwise, this needs to be configured on the targets screen for the workflow instance (different from the 3 above, which are on the SCM Instances screen).

Plugin Operations

Git Installation Steps

Git 1.7.9 or higher is needed for FlexDeploy. If yum installs a lower version by default, then you need to get the Git source code and build it for install. Here is reference - https://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/.

Run these steps as root. You can download a newer version than 2.7.1 as well.

  1. yes | yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

  2. yes | yum install gcc perl-ExtUtils-MakeMaker

  3. cd $HOME

  4. wget https://github.com/git/git/archive/v2.7.1.tar.gz

  5. tar -xvzf v2.7.1.tar.gz

  6. cd git-2.7.1/

  7. make prefix=/usr/local all

  8. make prefix=/usr/local install

On some other target groups including some Oracle Cloud instances, it may be necessary to either change lines 7+8 by removing the /local or by adding symlinks in /usr. The git executable must be on the path without running the .bash_profile or any other scripts because FlexDeploy won't run those scripts when SSHing to the endpoint.

Token authentication is required for GIT operations

Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. 

To create a Personal access token, follow the below link

https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

While generating Key Scope items is completely based on your requirement.

Basic permission to grant this token is required, Repo- Full control of private repositories

Admin:repo_hook- read:repo_hook read repository hooks for a clone, if you are doing commit from FlexDeploy then you need write:repo_hook

After generates token, In FlexDeploy, Update GIT password with the token at GIT Instance under Topology - Integrations - Source control tab

 

The following macros are not currently supported in the footer:
  • style