Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve credentialsId from job definition #11

Closed
wants to merge 2 commits into from

Conversation

marcusholl
Copy link
Member

No description provided.

Copy link
Contributor

@kbarnold kbarnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write a reasonable commit message as described in our contribution guidelines.

Also, the new script should be documented in the gh-pages documentation, ideally as part of the same commit.

@marcusholl marcusholl changed the title GitUtils Retrieve credentialsId from job definition Nov 17, 2017
@marcusholl marcusholl mentioned this pull request Nov 17, 2017
Copy link
Member

@o-liver o-liver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in documentation requested.

#### Example

```groovy
def gitUtils = new GitUtils()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 spaces after '='

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


```groovy
def gitUtils = new GitUtils()
assert gitUtils.getMandatoryParameter('https://example.com/myGitRepo.git') == 'credentials-key'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong function called. You mean getCredentialsId(), right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, stupid CutNPaste error, thanks ...

Copy link
Contributor

@alejandraferreirovidal alejandraferreirovidal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+2


## Constructors

### Utils()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitUtils()

* repository with the given url configured or there are no credentials
* maintained for that repository.
*/
def getCredentialsId(def repoUrl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def repoUrl --> def is not needed, and we don't use this syntax.

assert new GitUtils().getCredentialsId(repo) == 'credId'
}

private static void prepareRemoteConfigs(def configs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def configs --> def is not needed, and we don't use this syntax.

Resolves the credentialsId for a given repo from the
scm configuration in the job and from the job parameters.

In case a matching repo is found in the configured scms and
a credentialId is also provided as job parameter, the
credentialsId from the job parameters is used.

Depends on workflow-multibranch plugin since we make use
of the scm variable provided by that plugin.

With that change a new CredentialsUtils helper class in introduced
in order to ensure clear scopes with the helpers instead of
having all - basically unrelated - helper methods in one
big helper class.
should not be removed since, the tests needs it.
}

/*
* Do not remove/inline this method. The tests relies on it.
Copy link
Member

@o-liver o-liver Nov 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TYPO] ...The tests rely on it.

@marcusholl
Copy link
Member Author

Must not be merged at the moment since it is most probably superseded by PR #16 . I cannot "request changes" since I initiated that PR.

@marcusholl
Copy link
Member Author

Superseded by PR #16

@marcusholl marcusholl closed this Dec 1, 2017
@marcusholl marcusholl deleted the pr/gitutils branch December 1, 2017 15:20
tiloKo added a commit to rosemarieB/jenkins-library that referenced this pull request Sep 17, 2020
DanielMieg added a commit that referenced this pull request Sep 17, 2020
* adding my steps

* messy step

* Update abapEnvironmentAssembly.go

* clean up

* change yaml

* corrections

* Update cloudFoundryDeploy.go

* update

* delete simulation step

* remove simulate

* Update PiperGoUtils.groovy

* Update PiperGoUtils.groovy

* Update CommonStepsTest.groovy

* add docu

* Update abapEnvironmentAssembly.md

* changes due to PR

* Update .gitignore

* b

* CV list

* Update abapEnvironmentAssembly.go

* testing with simulation

* Update abapEnvironmentAssembly.go

* remove simulation

* renaming

* Update mkdocs.yml

* moving service key to yaml and fixing code climate

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* change input

* Update abapEnvironmentAssemblePackages.go

* change json tag

* fixed error handling

* documentation

* Update abapEnvironmentAssemblePackages.md

* Update abapEnvironmentAssemblePackages.md

* fixing code climate issues

* fixing code climate issues

* Update abapEnvironmentAssemblePackages.yaml

* fixing code climate issues

* Update abapEnvironmentAssemblePackages.yaml

* adding unittests

* adding unittests and improved logging

* yaml -> json

* change scope of cfServiceKeyName

* correct indentation

* Update CommonStepsTest.groovy

* maintain correct step order

* AAKaaS CheckCV step

* AAKaaS CheckCV step #2

* AAKaaS CheckCV step #3

* AAKaaS CheckCV step #4

* AAKaaS CheckCV step #5

* AAKaaS CheckCV step #6

* AAKaaS CheckCV step #7

* AAKaaS CheckCV step #8

* AAKaaS CheckCV step #9

* AAKaaS CheckCV step #10

* AAKaaS CheckCV step #11

* AAKaaS CheckCV step #12

* AAKaaS CheckCV step #13

Co-authored-by: rosemarieB <[email protected]>
Co-authored-by: Daniel Mieg <[email protected]>
Co-authored-by: Christopher Fenner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants