jenkins-pipelines/scripts/archive-misc.sh

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/"