You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
Adapt clone step to work with customer-managed Repos (BYOG) (#4966)
* adding byog credentials for clone command * adding unit tests for clone body * adding parameters * adding optional byog parameters * fixing typo in username * remove aliases in config yaml * change yaml config * logs * change info log * change logs * remove logs * adding log statements * remove log statements * fixing typo in test class * change repoTest structure * remove comment * remove comment * generate * adding unit test comments * adding error handling * adding isByog check * fixing unit test * generate * Update manageGitRepositoryUtils_test.go * restructure isByog parameter * adding empty line for md linter * adding config.yaml example to docs * Update documentation/docs/steps/abapEnvironmentCloneGitRepo.md Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> * Update documentation/docs/steps/abapEnvironmentCloneGitRepo.md Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> * Update documentation/docs/steps/abapEnvironmentCloneGitRepo.md Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> * Update documentation/docs/steps/abapEnvironmentCloneGitRepo.md Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> * Update documentation/docs/steps/abapEnvironmentCloneGitRepo.md Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> * adding release --------- Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
This commit is contained in:
@@ -97,3 +97,39 @@ abapEnvironmentCloneGitRepo (
|
||||
cfServiceKeyName: 'cfServiceKeyName'
|
||||
)
|
||||
```
|
||||
|
||||
## Example: Cloning a Bring Your Own Git (BYOG) repository
|
||||
|
||||
> Feature will be available in November 2024.
|
||||
|
||||
Since a ByoG repository is an external repository, you must be authenticated to clone it.
|
||||
For this, the corresponding credentials must be stored in Jenkins as a username and password/token.
|
||||
|
||||
<strong> Store the credentials: </strong> <br>
|
||||
A new credential with the type username and password must be stored.<br>
|
||||
`Jenkins Dashboard > Manage Jenkins > Credentials` <br>
|
||||
These credentials are used to clone the ByoG repository.
|
||||
More information on configuring the credentials can be found [here](https://www.jenkins.io/doc/book/using/using-credentials/).
|
||||
|
||||
The config.yaml should look like this:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
abapEnvironmentCloneGitRepo:
|
||||
repositories: 'repos.yaml'
|
||||
byogCredentialsId: 'byogCredentialsId'
|
||||
abapCredentialsId: 'abapCredentialsId'
|
||||
host: '1234-abcd-5678-efgh-ijk.abap.eu10.hana.ondemand.com'
|
||||
```
|
||||
|
||||
`byogCredentialsId: 'byogCredentialsId'` is the reference to the defined credential in Jenkins. So take care that this matches with your setup.
|
||||
|
||||
After that, the ByoG repository that is to be cloned must be specified in the repos.yaml:
|
||||
|
||||
```yaml
|
||||
repositories:
|
||||
- name: '/DMO/REPO_BYOG'
|
||||
branch: 'main'
|
||||
```
|
||||
|
||||
After the pipeline has run through, the repository has been cloned.
|
||||
|
Reference in New Issue
Block a user