1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

create collectionDisplayName inside of the step

This commit is contained in:
Christopher Fenner 2018-07-12 23:31:15 +02:00 committed by GitHub
parent 75a9a76205
commit 153536f5d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,10 +37,14 @@ def call(Map parameters = [:]) {
) { ) {
sh 'npm install newman --global --quiet' sh 'npm install newman --global --quiet'
for(String collection : collectionList){ for(String collection : collectionList){
def collectionDisplayName = collection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()
// resolve templates // resolve templates
def command = SimpleTemplateEngine.newInstance() def command = SimpleTemplateEngine.newInstance()
.createTemplate(config.newmanRunCommand) .createTemplate(config.newmanRunCommand)
.make([config: config.plus([newmanCollection: collection])]).toString() .make([
config: config.plus([newmanCollection: collection]),
collectionDisplayName: collectionDisplayName
]).toString()
if(!config.failOnError) command += ' --suppress-exit-code' if(!config.failOnError) command += ' --suppress-exit-code'
sh "newman ${command}" sh "newman ${command}"
} }