jenkins-pipelines/scripts/configure-build.sh
Davlet Panech 70b5f57491 Ignore docker image build errors in main build
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
2022-08-29 17:23:49 -04:00

83 lines
2.1 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
load_build_env
######################################################
# BUILD file
######################################################
build_info_file="$WORKSPACE_ROOT/BUILD"
release_info_file="${REPO_ROOT}/${RELEASE_INFO_FILE}"
if [[ -n "$SW_VERSION" ]] ; then
sw_version="$SW_VERSION"
elif [[ -n "$release_info_file" ]] ; then
sw_version=$(grep "PLATFORM_RELEASE=" "$release_info_file" | cut -d = -f 2 | tr -d '"')
[[ -n "$sw_version" ]] || die "unable to determine SW_VERSION"
else
die "unable to determine SW_VERSION"
fi
cat >"$build_info_file" <<_END
###
### Wind River Cloud Platform
### Release $sw_version
###
### Wind River Systems, Inc.
###
SW_VERSION="$sw_version"
BUILD_TARGET="Host Installer"
BUILD_TYPE="Formal"
BUILD_ID="$TIMESTAMP"
SRC_BUILD_ID="$BUILD_NUMBER"
JOB="$JOB_NAME"
BUILD_BY="$USER"
BUILD_NUMBER="$BUILD_NUMBER"
BUILD_HOST="$HOSTNAME"
BUILD_DATE="$(date '+%F %T %z')"
_END
notice "$build_info_file"
cat "$build_info_file"
######################################################
# stx.conf
######################################################
cd "$BUILD_HOME/repo/stx-tools"
rm -f stx.conf
unset DEBIAN_DISTRIBUTION DEBIAN_SNAPSHOT DEBIAN_SECURITY_SNAPSHOT
source ./import-stx
stx config --add builder.myuname "$USER"
stx config --add builder.uid "$USER_ID"
# Embedded in ~/localrc of the build container
stx config --add project.gituser "$USER_NAME"
stx config --add project.gitemail $USER_EMAIL
# This will be included in the name of your build container and the basename for $MY_REPO_ROOT_DIR
stx config --add project.name "$PROJECT"
stx config --add project.proxy false
# debian distro & urls
if [[ -n "$DEBIAN_SNAPSHOT_BASE" ]] ; then
stx config --add project.debian_snapshot_base "$DEBIAN_SNAPSHOT_BASE"
fi
if [[ -n "$DEBIAN_SECURITY_SNAPSHOT_BASE" ]] ; then
stx config --add project.debian_security_snapshot_base "$DEBIAN_SECURITY_SNAPSHOT_BASE"
fi
notice "$PWD/stx.conf"
cat stx.conf