jenkins-pipelines/scripts/archive-misc.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

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Archive evrything except:
# - symlinks that point to $BUILD_OUTPUT_HOME
# - localdisk/deploy/ which is archive separately by archive-iso.sh
# - large temp dirs left behind by ostree
#
set -e
source $(dirname "$0")/lib/job_utils.sh
load_build_env
#VERBOSE_ARG="--verbose"
exclude_args=()
exclude_args+=(--exclude "/localdisk/designer/**") # symlink inside
exclude_args+=(--exclude "/aptly") # symlink
exclude_args+=(--exclude "/mirrors") # symlink
exclude_args+=(--exclude "/docker") # symlink
exclude_args+=(--exclude "/workspace") # symlink
exclude_args+=(--exclude "/repo") # symlink
exclude_args+=(--exclude "/localdisk/workdir/**") # ostree temp files
exclude_args+=(--exclude "/localdisk/sub_workdir/workdir/**") # ostree temp files
exclude_args+=(--exclude "/localdisk/deploy/**") # archived by archive-iso.sh
mkdir -p "$BUILD_OUTPUT_HOME"
safe_copy_dir $DRY_RUN_ARG $VERBOSE_ARG \
"${exclude_args[@]}" \
"$BUILD_HOME/" "$BUILD_OUTPUT_HOME/"