Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 2.37 KB

gitTools.md

File metadata and controls

45 lines (32 loc) · 2.37 KB

gitTools

This part of the pipeline provides utility steps for common GIT operations.

Table of contents

mirrorRepository(String srcUrl, String targetUrl, List<String> srcCredentialIds = null, List<String> targetCredentialIds = null)

This step is a combination of:

This steps mirrors a GIT repository from srcUrl to targetUrl When no srcCredentialIds or targetCredentialIds are provided a auto lookup of the SSH or http(s) credentials will be performed.

mirrorRepositoryToRemote(String srcRepoPath, GitRepository targetRepo, List<String> targetCredentialIds = null)

Mirrors a local bare cloned repository form $WORKSPACE/$srcRepoPath to the targetRepo. When no targetCredentialIds are provided a auto lookup of the SSH or http(s) credentials will be performed.

mirrorRepositoryToWorkspace(GitRepository srcRepo, List<String> srcCredentialIds = null)

Mirrors the srcRepo to the current workspace. When no srcCredentialIds are provided a auto lookup of the SSH or http(s) credentials will be performed.

String getFetchOrigin(String remotes = null)

Utility function to get the fetch origin from a git remote list (git remote -v). When no remotes are provided the step will try to retrieve them by using the internal function _getRemotes which basically executes a git remote -v.

String getPushOrigin(String remotes = null)

Utility function to get the push origin from a git remote list (git remote -v). When no remotes are provided the step will try to retrieve them by using the internal function _getRemotes which basically executes a git remote -v.