Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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