Skip to content

Commit

Permalink
RHINENG-9413: store data outside of workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka authored and psegedy committed Apr 11, 2024
1 parent edc394f commit 29b652a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ if [[ -z "$RH_REGISTRY_USER" || -z "$RH_REGISTRY_TOKEN" ]]; then
exit 1
fi

AUTH_CONF_DIR="$(pwd)/.podman"
# Create tmp dir to store data in during job run (do NOT store in $WORKSPACE)
export TMP_JOB_DIR=$(mktemp -d -p "$HOME" -t "jenkins-${JOB_NAME}-${BUILD_NUMBER}-XXXXXX")
echo "job tmp dir location: $TMP_JOB_DIR"

function job_cleanup() {
echo "cleaning up job tmp dir: $TMP_JOB_DIR"
rm -fr $TMP_JOB_DIR
}

trap job_cleanup EXIT ERR SIGINT SIGTERM

AUTH_CONF_DIR="$TMP_JOB_DIR/.podman"
mkdir -p $AUTH_CONF_DIR
export REGISTRY_AUTH_FILE="$AUTH_CONF_DIR/auth.json"
podman login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
Expand Down

0 comments on commit 29b652a

Please sign in to comment.