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

47 lines
1.4 KiB
Bash

# bash
# vim: syn=sh:
# Define environment vars needed by the stx tool and jenkins scripts
# source build.conf
if [[ -z "$BUILD_CONF" ]] ; then
echo "reading $(dirname "${BASH_SOURCE[0]}")/build.conf" >&2
source "$(dirname "${BASH_SOURCE[0]}")/build.conf" || return 1
else
echo "reading $BUILD_CONF"
source "$BUILD_CONF" || return 1
fi
if [[ "$BUILD_USER" != "$(id -un)" ]] ; then
echo "This script can be used only by user $BUILD_USER!" >&2
return 1
fi
BUILD_HOME="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
# These are named differently in the stx tool
export STX_BUILD_HOME="$BUILD_HOME"
export STX_BUILD_CPUS="$BUILD_CPUS"
export STX_PLATFORM="$K8S_PLATFORM"
export STX_INSECURE_DOCKER_REGISTRIES="$INSECURE_DOCKER_REGISTRIES"
export STX_K8S_NAMESPACE="$K8S_NAMESPACE"
export STX_BUILD_CPUS="$BUILD_CPUS"
export STX_CONTAINER_MTU="$CONTAINER_MTU"
if [[ -z "$KUBECONFIG" ]] ; then
KUBECONFIG="$HOME/.kube/config"
fi
export KUBECONFIG
export PROJECT
export MINIKUBENAME
# source import-stx if it exists
if [[ -f "$BUILD_HOME/repo/stx-tools/import-stx" ]] ; then
echo "cd $BUILD_HOME/repo/stx-tools" >&2
cd "$BUILD_HOME/repo/stx-tools" || return 1
echo "sourcing ./import-stx" >&2
source ./import-stx || return 1
else
echo "WARNING: Build tools environment script $BUILD_HOME/repo/stx-tools/import-stx doesn't exist" >&2
fi