diff --git a/pipelines/monolithic.Jenkinsfile b/pipelines/monolithic.Jenkinsfile index 2fd3592..0f4bf40 100644 --- a/pipelines/monolithic.Jenkinsfile +++ b/pipelines/monolithic.Jenkinsfile @@ -313,6 +313,7 @@ or with paths relative to repo root: steps { script { runPart ("build-iso") runPart ("publish-iso") + sh ("BUILD_STATUS=success ${Constants.SCRIPTS_DIR}/create-latest-iso-symlinks.sh") } } } // stage('ISO') stage('IMAGES') { diff --git a/scripts/create-latest-iso-symlinks.sh b/scripts/create-latest-iso-symlinks.sh new file mode 100755 index 0000000..2cb9b97 --- /dev/null +++ b/scripts/create-latest-iso-symlinks.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# +# Copyright (c) 2022 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e +source $(dirname "$0")/lib/job_utils.sh + +require_job_env BUILD_STATUS + +load_build_env + +if $DRY_RUN ; then + bail "DRY_RUN=true, bailing out..." +fi + +set -x + +if [[ "$BUILD_STATUS" == "success" ]] ; then + ln -sfn "$TIMESTAMP" "$BUILD_OUTPUT_ROOT/latest_iso_build" + + if [[ -d "$PUBLISH_ROOT/$PUBLISH_TIMESTAMP" ]] ; then + if ! same_path "$BUILD_OUTPUT_ROOT" "$PUBLISH_ROOT" ; then + ln -sfn "$PUBLISH_TIMESTAMP" "$PUBLISH_ROOT/latest_iso_build" + fi + fi +fi