
Currently errors in docker image builds fail the entire build. Docker images are in flux, and are likely to cause every build to fail. Workaround: don't fail the main build if some docker images failed (but print out a warning in Jenkins log). Changes: - Ignore docker image build errors with a warning - Misc changes to scripts to make sure various steps happen in the right order Story: 2010226 Task: 46146 Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: Ib8869ce263731f7bce3157890c303ec5cec59fde
54 lines
1.4 KiB
Bash
Executable File
54 lines
1.4 KiB
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_env BUILD_STATUS
|
|
|
|
load_build_env
|
|
|
|
if $DRY_RUN ; then
|
|
bail "DRY_RUN=true, bailing out..."
|
|
fi
|
|
|
|
ARCHIVE_ROOT=$(dirname "$BUILD_OUTPUT_HOME")
|
|
|
|
set -x
|
|
|
|
if [[ "$BUILD_STATUS" == "success" ]] ; then
|
|
ARCHIVE_ROOT=$(dirname "$BUILD_OUTPUT_HOME")
|
|
link_target=$(basename "$BUILD_OUTPUT_HOME")
|
|
|
|
# find image list files
|
|
image_list_files_str="$(
|
|
find "$BUILD_OUTPUT_HOME/workspace/std/build-images" \
|
|
-mindepth 1 -maxdepth 1 \
|
|
-type f -name 'images-*.lst' \
|
|
| sed -r -e 's/^\s+//' -e 's/\s+$//' \
|
|
| grep -E -v -e '^\s#' -e '^\s*$'
|
|
)" || exit 1
|
|
declare -a image_list_files
|
|
readarray -t image_list_files <<<"$image_list_files_str"
|
|
|
|
# more than one - success
|
|
if [[ "${#image_list_files[@]}" -gt 0 ]] ; then
|
|
|
|
# archive LAST_COMMITS & latest symlink
|
|
cp "$BUILD_OUTPUT_HOME/LAST_COMMITS" "$ARCHIVE_ROOT/LAST_COMMITS_IMG_STABLE"
|
|
ln -sfn "$link_target" "$ARCHIVE_ROOT/latest_docker_image_build"
|
|
|
|
# publish image lists & latest symlink
|
|
cp "${image_list_files[@]}" "$PUBLISH_ROOT/"
|
|
if ! same_path "$ARCHIVE_ROOT" "$PUBLISH_ROOT" ; then
|
|
ln -sfn "$link_target" "$PUBLISH_ROOT/latest_docker_image_build"
|
|
fi
|
|
|
|
fi
|
|
fi
|