Skip to content

Commit

Permalink
build(generated): update metadata format
Browse files Browse the repository at this point in the history
Generated SDK source code using:
- Generator version 3.90.0
- Specification version 1.0.0-dev0.1.9
- Automation (cloudant-sdks) version 1c32f6a

Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com>
  • Loading branch information
cloudant-sdks-automation authored and ricellis committed May 7, 2024
1 parent 4d0f9ac commit 6b9b134
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def scanCode
void defaultInit() {
// Default to using bump2version
bumpVersion = { isDevRelease ->
newVersion = getNewVersion(isDevRelease, true)
newVersion = getNewVersion(isDevRelease)
// Set an env var with the new version
env.NEW_SDK_VERSION = newVersion
doVersionBump(isDevRelease, newVersion)
Expand All @@ -202,9 +202,9 @@ void defaultInit() {
sh "bump2version --new-version ${newVersion} ${allowDirty ? '--allow-dirty': ''} ${isDevRelease ? '--no-commit' : '--tag --tag-message "Release {new_version}"'} patch"
}

getNewVersion = { isDevRelease, includeBuildMeta ->
getNewVersion = { isDevRelease ->
// Get a staging or target version and customize with lang specific requirements
return customizeVersion(isDevRelease ? getDevVersion(includeBuildMeta) : getTargetVersion())
return customizeVersion(isDevRelease ? getDevVersion() : getTargetVersion())
}

getTargetVersion = {
Expand All @@ -218,19 +218,20 @@ void defaultInit() {
return version.trim()
}

getDevVersion = { includeBuildMeta ->
getDevVersion = {
devVersion = getTargetVersion()
if (devVersion ==~ /${env.SVRE_RELEASE}/) {
// For a release (e.g. 1.0.0) make a -dev pre-release (e.g. 1.0.0-devTS)
devVersion += "-dev${currentBuild.startTimeInMillis}"
// For a release (e.g. 1.0.0) use a hyphen separator (e.g. 1.0.0-dev)
devVersion += "-"
} else if (devVersion ==~ /${env.SVRE_PRE_RELEASE}/) {
// For a pre-release (e.g. 1.0.0-b7), add .dev identifier (e.g. 1.0.0-b7.devTS)
devVersion += ".dev${currentBuild.startTimeInMillis}"
}
if (includeBuildMeta) {
// Add uniqueness and build metadata when requested to dev build versions
devVersion += "+${commitHash}.${currentBuild.number}"
// For a pre-release (e.g. 1.0.0-b7), add dot separator (e.g. 1.0.0-b7.dev)
devVersion += "."
}
// Now add dev identifier (a number is required by some package managers)
devVersion += "dev0"
// Add uniqueness with build metadata to dev build versions
devVersion += "+git${commitHash}.${currentBuild.startTimeInMillis}.${currentBuild.number}"

return devVersion
}

Expand Down

0 comments on commit 6b9b134

Please sign in to comment.