mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
0b8b6f2b0c
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com> Co-authored-by: Florian Geckeler <f.geckeler@sap.com>
23 lines
1.0 KiB
Groovy
23 lines
1.0 KiB
Groovy
import com.sap.piper.DownloadCacheUtils
|
|
import groovy.transform.Field
|
|
|
|
import static groovy.json.JsonOutput.toJson
|
|
|
|
@Field String STEP_NAME = getClass().getName()
|
|
@Field String METADATA_FILE = 'metadata/nexusUpload.yaml'
|
|
|
|
//Metadata maintained in file project://resources/metadata/nexusUpload.yaml
|
|
|
|
void call(Map parameters = [:]) {
|
|
// Replace 'additionalClassifiers' List with JSON encoded String.
|
|
// This is currently necessary, since the go code doesn't support complex/arbitrary parameter types.
|
|
// TODO: Support complex/structured types of parameters in piper-go
|
|
if (parameters.additionalClassifiers) {
|
|
parameters.additionalClassifiers = "${toJson(parameters.additionalClassifiers as List)}"
|
|
}
|
|
parameters = DownloadCacheUtils.injectDownloadCacheInMavenParameters(parameters.script, parameters)
|
|
|
|
List credentials = [[type: 'usernamePassword', id: 'nexusCredentialsId', env: ['PIPER_username', 'PIPER_password']]]
|
|
piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials)
|
|
}
|