
lib/job_utils.sh: function "require_env" conflicts with the like-named function in utils.sh. Rename it to "require_job_env". Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: I557cf14c4a3df000be245471cef5663e49badb06
43 lines
964 B
Bash
Executable File
43 lines
964 B
Bash
Executable File
#!/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
|
|
|
|
touch "$BUILD_OUTPUT_HOME/FAIL"
|
|
|
|
ARCHIVE_ROOT=$(dirname "$BUILD_OUTPUT_HOME")
|
|
|
|
if [[ "$BUILD_STATUS" == "success" ]] ; then
|
|
ARCHIVE_ROOT=$(dirname "$BUILD_OUTPUT_HOME")
|
|
link_target=$(basename "$BUILD_OUTPUT_HOME")
|
|
cp "$BUILD_OUTPUT_HOME/LAST_COMMITS" "$ARCHIVE_ROOT/"
|
|
ln -sfn "$link_target" "$ARCHIVE_ROOT/latest_build"
|
|
|
|
rm -f "$BUILD_OUTPUT_HOME/FAIL"
|
|
touch "$BUILD_OUTPUT_HOME/SUCCESS"
|
|
|
|
if [[ -d "$PUBLISH_ROOT/$TIMESTAMP" ]] ; then
|
|
mkdir -p "$PUBLISH_DIR/outputs"
|
|
touch "$PUBLISH_DIR/outputs/Success"
|
|
if ! same_path "$ARCHIVE_ROOT" "$PUBLISH_ROOT" ; then
|
|
ln -sfn "$link_target" "$PUBLISH_ROOT/latest_build"
|
|
fi
|
|
fi
|
|
fi
|