Fix version format
This commit is contained in:
parent
d14d02717d
commit
ddf1534abd
@ -45,7 +45,7 @@ Map call(Map config = [:], Map queryParams = [:]) {
|
||||
/* groovylint-disable-next-line Instanceof */
|
||||
if (latest.version instanceof net.sf.json.JSONNull && latest.name) {
|
||||
echo 'Info: Search result version field was null, looking in name field for a version'
|
||||
java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/)
|
||||
java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.].*)/)
|
||||
if (!match) {
|
||||
echo "Error: Match: ${match}"
|
||||
error("Regular expression match failed for latest.name: ${latest.name}")
|
||||
|
||||
@ -22,7 +22,7 @@ String call(Map config = [:], Closure body = { }) {
|
||||
archiveName = runConfig.name +
|
||||
runConfig.separator +
|
||||
(runConfig.useHash ? runConfig.hash : runConfig.version) +
|
||||
runConfig.separator +
|
||||
'.' +
|
||||
runConfig.extension
|
||||
|
||||
echo "Info: Will archive results as: ${archiveName}."
|
||||
|
||||
@ -1,16 +1,18 @@
|
||||
|
||||
void call(Map config = [:], String packageName) {
|
||||
publishURL = [ config.nexusBase, config.nexusRepository, config.nexusRepoPath, packageName ].join('/')
|
||||
publishURL = [ config.nexusBase, 'repository', config.nexusRepository, config.nexusRepoPath, packageName ].join('/')
|
||||
|
||||
echo 'Info: Publishing...'
|
||||
echo "Info: ${publishURL}"
|
||||
response = httpRequest httpMode: 'POST',
|
||||
authenticate: 'publisher',
|
||||
response = httpRequest authentication: 'publisher',
|
||||
consoleLogResponseBody: true,
|
||||
contentType: ' APPLICATION_FORM_DATA',
|
||||
contentType: 'APPLICATION_FORM_DATA',
|
||||
url: publishURL,
|
||||
wrapAsMultipart: true,
|
||||
requestBody: [$class: 'FileRequestBody', file: packageName]
|
||||
httpMode: 'PUT',
|
||||
validResponseCodes: '201',
|
||||
multipartName: "${packageName}",
|
||||
uploadFile: packageName
|
||||
|
||||
echo "Response: ${response.content}"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user