Guard version env defaults in pipeline

This commit is contained in:
Brad Stein 2025-12-18 11:08:45 -03:00
parent ab8f57583a
commit 9664863c40

6
Jenkinsfile vendored
View File

@ -64,8 +64,8 @@ spec:
REGISTRY = 'registry.bstein.dev/bstein' REGISTRY = 'registry.bstein.dev/bstein'
FRONT_IMAGE = "${REGISTRY}/bstein-dev-home-frontend" FRONT_IMAGE = "${REGISTRY}/bstein-dev-home-frontend"
BACK_IMAGE = "${REGISTRY}/bstein-dev-home-backend" BACK_IMAGE = "${REGISTRY}/bstein-dev-home-backend"
VERSION_TAG = '' VERSION_TAG = 'dev'
SEMVER = '' SEMVER = 'dev'
} }
options { options {
disableConcurrentBuilds() disableConcurrentBuilds()
@ -113,7 +113,7 @@ spec:
echo "SEMVER=${SEMVER}" > build.env echo "SEMVER=${SEMVER}" > build.env
''' '''
def props = readProperties file: 'build.env' def props = readProperties file: 'build.env'
env.SEMVER = props['SEMVER'] env.SEMVER = props['SEMVER'] ?: "0.1.0-${env.BUILD_NUMBER}"
env.VERSION_TAG = env.SEMVER env.VERSION_TAG = env.SEMVER
} }
} }