Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up local tmp if it has been saved to a tarball #267

Open
wants to merge 3 commits into
base: 2023.06-software.eessi.io
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,24 @@ echo " -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_PI
./eessi_container.sh "${COMMON_ARGS[@]}" "${TARBALL_STEP_ARGS[@]}" \
-- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_PILOT_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}

function check_tmp_tarball {
dir=$1
ls ${dir} | grep -E 'tgz$|\.gz$'
return $?
}

# clean storage used on local disk
if [[ -d ${STORAGE} ]]; then
# double-check that at least one tarball of the temporary storage was created
if check_tmp_tarball ${TARBALL_TMP_BUILD_STEP_DIR} || check_tmp_tarball ${TARBALL_TMP_TARBALL_STEP_DIR}; then
echo "Removing temporary storage under '${STORAGE}'"
# rm -rf ${STORAGE}
boegel marked this conversation as resolved.
Show resolved Hide resolved
else
echo "Did not find any tarball containing the temporary storage for neither the"
echo "build nor the tar step. Hence, not removing the storage at '${STORAGE}'."
fi
else
echo "Local disk storage at '${STORAGE}' not accessible, so wasn't cleaned up."
fi

exit 0