Created
February 26, 2020 07:37
-
-
Save marcusramberg/a599f42174cb774706ba27c67a744cd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vars/shaslSpringDeploy.groovy b/vars/shaslSpringDeploy.groovy | |
index faa7e52..3ea72e7 100644 | |
--- a/vars/shaslSpringDeploy.groovy | |
+++ b/vars/shaslSpringDeploy.groovy | |
@@ -43,7 +43,15 @@ def call(Map config) { | |
DEPLOY_ENV = params.Environment | |
REGION = params.Region | |
VERSION = params.Version | |
- // MAJOR_VERSION = readMavenPom().getVersion() | |
+ version = readMavenPom().getVersion() | |
+ def match = version =~ /^(\d+)/ | |
+ if (match.find()) { | |
+ MAJOR_VERSION ||= match[0][1] | |
+ } | |
+ if(!MAJOR_VERSION) { | |
+ throw new Exception("MAJOR_VERSION missing and could not be parsed from POM") | |
+ } | |
+ | |
ACCOUNT_ID = shaslGetAccountID(DEPLOY_ENV) | |
IMAGE_TAG = "${SERVICE_CANONICAL_NAME}_v${VERSION}" | |
REPO_NAME = VERSION.contains('SNAPSHOT') ? SSL_REPOSITORY_NAME_SNAPSHOTS : SSL_REPOSITORY_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment