1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

[newmanExecute] Allow env vars in the runOptions (#3966)

* Allow env vars in the runOptions

* Add documentation

* Regenerate for documentation

* Fix documentation
This commit is contained in:
Oliver Feldmann
2023-01-11 11:59:09 +01:00
committed by GitHub
parent 844d4210ec
commit b639c98890
5 changed files with 36 additions and 3 deletions

View File

@@ -46,6 +46,20 @@ If the following error occurs during the pipeline run, the `newmanRunCommand` is
Referencing `newmanEnvironment` and `newmanGlobals` in the runOptions is redundant now. Both parameters are added to runCommand using `newmanEnvironment` and `newmanGlobals` from config when configured and not referenced by go templating using `"--environment", "{{`{{.Config.NewmanEnvironment}}`}}"` and `"--globals", "{{`{{.Config.NewmanGlobals}}`}}"` as shown above.
## Passing Credentials
If you need to pass additional credentials you can do so via environment
variables. This is done via templating in the `runOptions`, as per this example:
```yaml
runOptions: [
{{`"run", "{{.NewmanCollection}}",`}}
{{`"--environment", "{{.Config.NewmanEnvironment}}",`}}
{{`"--env-var", "username={{getenv \"PIPER_TESTCREDENTIAL_USERNAME\"}}",`}}
{{`"--env-var", "password={{getenv \"PIPER_TESTCREDENTIAL_PASSWORD\"}}"`}}
]
```
## Example
Pipeline step: