Use private yum cache dir in build scripts

YUM & friends use a cache directory named /tmp/yum-$USER-xxx or
similar, even when used concurrently e.g. when bulding unrelated
source trees. This causes interference between CI pipelines.

This patch sets TMPDIR=$MY_WORKSPACE/tmp when calling repoquery,
etc.

Change-Id: Ieeb4d6fd9447f1c2988380c3427975893be365a5
Closes-Bug: 1867817
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
This commit is contained in:
Davlet Panech 2020-03-18 16:29:40 -04:00
parent 3b0e2dd4ea
commit f5985aa83a
5 changed files with 21 additions and 1 deletions

View File

@ -492,7 +492,7 @@ function extract_pkg_from_local_repo {
repoid_arg+=" --repoid=${repoid}"
done
local pkgfile=$(repoquery --config=${yum_conf} ${repoid_arg} --location -q ${pkgname})
local pkgfile=$(TMPDIR=$TMP_DIR repoquery --config=${yum_conf} ${repoid_arg} --location -q ${pkgname})
if [ -z "${pkgfile}" ]; then
echo "Could not find package $pkgname in $@"
exit 1

View File

@ -36,6 +36,9 @@ if [ $? -ne 0 ]; then
SERIAL_FLAG=1
fi
export TMPDIR=$MY_WORKSPACE/tmp
mkdir -p $TMPDIR
# Make sure we have a dependency cache
DEP_CACHE="$MY_REPO/cgcs-tis-repo/dependancy-cache"

View File

@ -1593,6 +1593,10 @@ if [ ! -f $BUILD_CFG ]; then
exit 1
fi
# create temp dir
export TMPDIR="$MY_WORKSPACE/tmp"
mkdir -p "$TMPDIR"
# Create symlinks from /var/... to /localdisk/loadbuild/... if on a build server
set_mock_symlinks $MY_BUILD_CFG

View File

@ -1362,6 +1362,10 @@ if [ ! -f $BUILD_CFG ]; then
exit 1
fi
# create temp dir
export TMPDIR="$MY_WORKSPACE/tmp"
mkdir -p $TMPDIR
# Create symlinks from /var/... to /localdisk/loadbuild/... if on a build server
set_mock_symlinks $MY_BUILD_CFG

View File

@ -14,6 +14,11 @@ if [ -z "${MY_REPO}" ]; then
exit 1
fi
if [ -z "${MY_WORKSPACE}" ]; then
echo "Required environment variable MY_WORKSPACE is not set"
exit 1
fi
STX_DIR=${MY_REPO}/stx
SETUP_PATCH_REPO=${STX_DIR}/update/extras/scripts/setup_patch_repo.sh
if [ ! -x ${SETUP_PATCH_REPO} ]; then
@ -21,6 +26,10 @@ if [ ! -x ${SETUP_PATCH_REPO} ]; then
exit 1
fi
# Create temp dir if necessary
export TMPDIR="$MY_WORKSPACE/tmp"
mkdir -p $TMPDIR
REPO_UPGRADES_DIR=${STX_DIR}/metal/bsp-files/upgrades
RELEASE_INFO="$(get_release_info)"