Add publish step
This commit is contained in:
parent
e4ca5276a7
commit
77735a9cb3
@ -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}"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user