mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
Improve documentation for protecodeExecuteScan (#3076)
* Improve documentation for protecodeExecuteScan protecodeExecuteScan expects that the docker config file is named 'config.json'. The dockerConfigJSON parameter is used by protecodeExecuteScan to retrieve the directory only (for environment variable DOCKER_CONFIG). * Also improve documentation that is generated * No relative references in generated documentation. * Less complex documentation * Remove irrelevant empty line * Improvements after review * Add blank line after code block * Handle registry URL example as code Markdown format checker does not like raw URLs. Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
This commit is contained in:
parent
01c687bbdc
commit
8c5986bbfa
@ -208,7 +208,7 @@ func protecodeExecuteScanMetadata() config.StepData {
|
||||
Inputs: config.StepInputs{
|
||||
Secrets: []config.StepSecrets{
|
||||
{Name: "protecodeCredentialsId", Description: "Jenkins 'Username with password' credentials ID containing username and password to authenticate to the Protecode system.", Type: "jenkins"},
|
||||
{Name: "dockerConfigJsonCredentialsId", Description: "Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)). You can create it like explained in the Docker Success Center in the article about [how to generate a new auth in the config.json file](https://success.docker.com/article/generate-new-auth-in-config-json-file).", Type: "jenkins", Aliases: []config.Alias{{Name: "dockerCredentialsId", Deprecated: true}}},
|
||||
{Name: "dockerConfigJsonCredentialsId", Description: "Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)). You can create it like explained in [Prerequisites](https://www.project-piper.io/steps/protecodeExecuteScan/#prerequisites).", Type: "jenkins", Aliases: []config.Alias{{Name: "dockerCredentialsId", Deprecated: true}}},
|
||||
},
|
||||
Parameters: []config.StepParameters{
|
||||
{
|
||||
|
@ -8,7 +8,25 @@
|
||||
1. Look up your Group ID using REST API via `curl -u <username> "https://<protecode host>/api/groups/"`.
|
||||
|
||||
If the image is on a protected registry you can provide a Docker `config.json` file containing the credential information for the registry.
|
||||
You can create it like explained in the Docker Success Center in the article about [how to generate a new auth in the config.json file](https://success.docker.com/article/generate-new-auth-in-config-json-file).
|
||||
You can either use `docker login` (see the [Docker documentation](https://docs.docker.com/engine/reference/commandline/login/) for details) or you can create the file manually using the following script.
|
||||
|
||||
```shell
|
||||
#!/bin/bash
|
||||
auth=$(echo -n "$USER:$PASSWORD" | base64 -w0)
|
||||
cat <<EOF > config.json
|
||||
{
|
||||
"auths": {
|
||||
"$REGISTRY": {
|
||||
"auth": "$auth"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
`REGISTRY` is the URL of the protected registry (Example: `https://index.docker.io/v1`).
|
||||
|
||||
Attention: If you reference the file in --dockerConfigJSON or upload the file to the Jenkins credential store, the file has to be named `config.json`.
|
||||
|
||||
## ${docGenParameters}
|
||||
|
||||
|
@ -13,7 +13,7 @@ spec:
|
||||
description: Jenkins 'Username with password' credentials ID containing username and password to authenticate to the Protecode system.
|
||||
type: jenkins
|
||||
- name: dockerConfigJsonCredentialsId
|
||||
description: Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)). You can create it like explained in the Docker Success Center in the article about [how to generate a new auth in the config.json file](https://success.docker.com/article/generate-new-auth-in-config-json-file).
|
||||
description: Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)). You can create it like explained in [Prerequisites](https://www.project-piper.io/steps/protecodeExecuteScan/#prerequisites).
|
||||
type: jenkins
|
||||
aliases:
|
||||
- name: dockerCredentialsId
|
||||
|
Loading…
x
Reference in New Issue
Block a user