diff options
author | Martin Stockhammer <martin.stockhammer@ars.de> | 2017-11-15 23:10:37 +0100 |
---|---|---|
committer | Martin Stockhammer <martin.stockhammer@ars.de> | 2017-11-15 23:10:37 +0100 |
commit | 7236f4d8a93b4db42694cfa919473ec288546dc7 (patch) | |
tree | 7c5a8b4bee06dc7d7b54d8a8a97f24232a682c6e /src | |
parent | bc9256ad08b61b100693fe6c266f6fed579987af (diff) | |
download | archiva-7236f4d8a93b4db42694cfa919473ec288546dc7.tar.gz archiva-7236f4d8a93b4db42694cfa919473ec288546dc7.zip |
Adding tmp dir cleanup to ci prepare script
Diffstat (limited to 'src')
-rw-r--r-- | src/ci/scripts/prepareWorkspace.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/ci/scripts/prepareWorkspace.sh b/src/ci/scripts/prepareWorkspace.sh index c9d1d8d69..b79cd4457 100644 --- a/src/ci/scripts/prepareWorkspace.sh +++ b/src/ci/scripts/prepareWorkspace.sh @@ -22,7 +22,7 @@ # # Removes directories that are not used anymore. ## -ATTIC_DIRS="" +ATTIC_DIRS="archiva-modules/archiva-base/archiva-indexer" REMOVE_DIRS=".indexer" for i in ${ATTIC_DIRS}; do @@ -35,3 +35,22 @@ done for i in ${REMOVE_DIRS}; do find . -type d -name "${i}" -print0 | xargs -0 rm -rvf done + +TMP_DIRS="/tmp/archiva /var/tmp/archiva" +for MY_TMP in $TMP_DIRS; do + if [ -e ${MY_TMP} ]; then + echo "Trying to delete ${MY_TMP}" + rm -rf ${MY_TMP} >/dev/null 2>&1 + fi + if [ -e ${MY_TMP} ]; then + echo "Trying to move ${MY_TMP} away" + mv ${MY_TMP} ${MY_TMP}.$$ + fi + if [ -e ${MY_TMP} ]; then + echo "Warning there exists a temporary directory, that cannot be cleaned ${MY_TMP}" + ls -latr ${MY_TMP} + ls -latr $(dirname ${MY_TMP}) + fi +done + +exit 0 |