1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00

Lookup mtar in the whole workspace (#492)

* allow mtar lookup in the whole workspace

* minor fixes
This commit is contained in:
weloli 2019-02-07 08:58:00 +01:00 committed by GitHub
parent aa6e42fbfc
commit 826e216cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,9 +37,7 @@ void call(Map parameters = [:]) {
def utils = parameters.juStabUtils ?: new Utils()
def jenkinsUtils = parameters.jenkinsUtilsStub ?: new JenkinsUtils()
def script = checkScript(this, parameters)
if (script == null)
script = this
final script = checkScript(this, parameters) ?: this
Map config = ConfigurationHelper.newInstance(this)
.loadStepDefaults()
@ -123,11 +121,10 @@ void call(Map parameters = [:]) {
}
def findMtar(){
def mtarPath = ''
def mtarFiles = findFiles(glob: '**/target/*.mtar')
def mtarFiles = findFiles(glob: '**/*.mtar')
if(mtarFiles.length > 1){
error 'Found multiple *.mtar files, please specify file via mtaPath parameter! ${mtarFiles}'
error "Found multiple *.mtar files, please specify file via mtaPath parameter! ${mtarFiles}"
}
if(mtarFiles.length == 1){
return mtarFiles[0].path