🔘Jenkins

How to add Pynt into Jenkins

Add Pynt ID to Jenkins environment variables:

An example for a Jenkins job running Pynt newman against goat collection:

echo "Pynt API Security testing"

# Using venv is a good practice
python3 -m venv myenv
. myenv/bin/activate

pip install pyntcli
export PATH=$PATH:/var/lib/jenkins/.local/lib/python3.10/site-packages

curl https://raw.githubusercontent.com/pynt-io/pynt/main/goat_functional_tests/goat.postman_collection.json -o goat.json 
pynt newman --collection goat.json --reporters
cat pynt_results.json

deactivate

Controlling the return code from Pynt

pynt newman and pynt command have an optional flag --return-error

With this flag, you have granular control over whether Pynt returns an error code (non zero) in the event of findings. Use this flag to control when Pynt will break the CI/CD run, allowed values are:

'all-findings' (warnings or errors),
'errors-only',
'never' (default)

Last updated