Clean up constants
This commit is contained in:
parent
12df0f4986
commit
38997fc803
@ -12,11 +12,11 @@ Jenkins Plugin dependencies:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Define the enum
|
// Define the enum
|
||||||
enum Flags {
|
enum BuildNumFlags {
|
||||||
|
|
||||||
BUILDNUM_IS_COMMITS_SINCE_TAG,
|
IS_COMMITS_SINCE_TAG,
|
||||||
BUILDNUM_IS_JOB_NUMBER,
|
IS_JOB_BUILD_NUMBER,
|
||||||
BUILDNUM_IS_FROM_QUERY
|
IS_FROM_QUERY
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ Map call(Map config = [:]) {
|
|||||||
Map defaults = [
|
Map defaults = [
|
||||||
nexusBase: 'https://repo.thejimnicholson.com',
|
nexusBase: 'https://repo.thejimnicholson.com',
|
||||||
searchAPI: 'service/rest/v1/search',
|
searchAPI: 'service/rest/v1/search',
|
||||||
build_flag: Flags.BUILDNUM_IS_FROM_QUERY,
|
build_flag: BuildNumFlags.IS_FROM_QUERY,
|
||||||
queryParams: [
|
queryParams: [
|
||||||
'repository': 'tools',
|
'repository': 'tools',
|
||||||
'sort': 'name',
|
'sort': 'name',
|
||||||
@ -51,16 +51,16 @@ Map call(Map config = [:]) {
|
|||||||
query_build = matches[2]
|
query_build = matches[2]
|
||||||
}
|
}
|
||||||
switch (build_flag) {
|
switch (build_flag) {
|
||||||
case Flags.BUILDNUM_IS_COMMITS_SINCE_TAG:
|
case BuildNumFlags.IS_COMMITS_SINCE_TAG:
|
||||||
build = sh(
|
build = sh(
|
||||||
script: 'git rev-list $(git tag | tail -1).. --count',
|
script: 'git rev-list $(git tag | tail -1).. --count',
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
break
|
break
|
||||||
case Flags.BUILDNUM_IS_JOB_NUMBER:
|
case BuildNumFlags.IS_JOB_BUILD_NUMBER:
|
||||||
build = env.BUILD_NUMBER
|
build = env.BUILD_NUMBER
|
||||||
break
|
break
|
||||||
case Flags.BUILDNUM_IS_FROM_QUERY:
|
case BuildNumFlags.IS_FROM_QUERY:
|
||||||
build = query_build
|
build = query_build
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user