-
Notifications
You must be signed in to change notification settings - Fork 593
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
Conversation
There was a problem hiding this 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.
0e913da
to
bb5a00f
Compare
There was a problem hiding this 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces after '='
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ...
bb5a00f
to
593c3a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+2
|
||
## Constructors | ||
|
||
### Utils() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitUtils()
src/com/sap/piper/GitUtils.groovy
Outdated
* repository with the given url configured or there are no credentials | ||
* maintained for that repository. | ||
*/ | ||
def getCredentialsId(def repoUrl) { |
There was a problem hiding this comment.
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.
test/groovy/GitUtilsTest.groovy
Outdated
assert new GitUtils().getCredentialsId(repo) == 'credId' | ||
} | ||
|
||
private static void prepareRemoteConfigs(def configs) { |
There was a problem hiding this comment.
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.
593c3a7
to
aec9d09
Compare
should not be removed since, the tests needs it.
} | ||
|
||
/* | ||
* Do not remove/inline this method. The tests relies on it. |
There was a problem hiding this comment.
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.
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. |
Superseded by PR #16 |
* 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]>
No description provided.