Add publish step

This commit is contained in:
Jim Nicholson 2024-02-26 14:37:27 -08:00
parent e4ca5276a7
commit 77735a9cb3

View File

@ -2,4 +2,17 @@
void call(Map config = [:], String packageName) {
publishURL = [ config.nexusBase, config.nexusRepository, config.nexusRepoPath, packageName ].join('/')
echo "Info: ${publishURL}"
withCredentials([usernameColonPassword(credentialsId: 'publisher', variable: 'NEXUS_PUBLISH')]) {
response = httpRequest httpMode: 'POST',
contentType: 'multipart/form-data',
url: publishURL,
wrapAsMultipart: true,
customHeaders: [
[name: 'Authorization', value: 'Basic ' + "${env.NEXUS_PUBLISH}".bytes.encodeBase64()]
],
requestBody: [$class: 'FileRequestBody', file: packageName]
echo "Response: ${response.content}"
}
}