1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +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'
for(String collection : collectionList){
def collectionDisplayName = collection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()
// resolve templates
def command = SimpleTemplateEngine.newInstance()
.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'
sh "newman ${command}"
}