Skip to content

Commit

Permalink
Fixes #RHINENG-9415 - Fix for build_deploy.sh (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
patilsuraj767 authored Apr 11, 2024
1 parent c746a3f commit 653565a
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 @@ -18,7 +18,18 @@ if [[ -z "$RH_REGISTRY_USER" || -z "$RH_REGISTRY_TOKEN" ]]; then
exit 1
fi

DOCKER_CONF="$PWD/.docker"
# 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

DOCKER_CONF="$TMP_JOB_DIR/.docker"
mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" login -u="$RH_REGISTRY_USER" -p="$RH_REGISTRY_TOKEN" registry.redhat.io
Expand Down

0 comments on commit 653565a

Please sign in to comment.