1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/vars/nexusUpload.groovy
Stephan Aßmus 0b8b6f2b0c
Migrate stage artifact deployment from Cloud SDK Pipeline-Lib (#1324)
Co-authored-by: Daniel Kurzynski <daniel.kurzynski@sap.com>
Co-authored-by: Florian Geckeler <f.geckeler@sap.com>
2020-03-31 15:16:18 +02:00

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)
}