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
[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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user