Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2017-05-04 07:55:24 -0400
committerSravan Kumar Lakkimsetti2017-05-04 07:57:15 -0400
commita9225beedd56fbdfd661d3833b0d08a91aaa9683 (patch)
tree8ef08ae96a02416cb3a8a7f80270764e8f45f0db /production
parent658169d4e7298272fbc0d3f2f6767bb029f9ae41 (diff)
downloadeclipse.platform.releng.aggregator-a9225beedd56fbdfd661d3833b0d08a91aaa9683.tar.gz
eclipse.platform.releng.aggregator-a9225beedd56fbdfd661d3833b0d08a91aaa9683.tar.xz
eclipse.platform.releng.aggregator-a9225beedd56fbdfd661d3833b0d08a91aaa9683.zip
Bug 507271 - Implement new build retention policy for I-builds
Change-Id: Ic8a2dcbc2b689e56dce62d9f2d888a12ab475350 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
Diffstat (limited to 'production')
-rwxr-xr-xproduction/sdk/cleaners/dailyCleanDownloads.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/production/sdk/cleaners/dailyCleanDownloads.sh b/production/sdk/cleaners/dailyCleanDownloads.sh
index c3868ba2..1a31e6ea 100755
--- a/production/sdk/cleaners/dailyCleanDownloads.sh
+++ b/production/sdk/cleaners/dailyCleanDownloads.sh
@@ -22,7 +22,7 @@ fi
echo -e "\n\tDaily clean of ${HOSTNAME} download server on $(date )\n"
#
-# Checks whether a build can be retained or not.
+# Checks whether a build can be retained or not.
# returns 0 if the build can be retained
#
function canBeRetained ()
@@ -46,7 +46,7 @@ function canBeRetained ()
function removeBuild ()
{
- buildName=$1
+ buildname=$1
rm -fr $buildname
RC=$?
if [[ $RC = 0 ]];then
@@ -90,7 +90,7 @@ areNotToDelete=$(printf '%s\n' "${newest[@]}" | paste -sd '|')
currentWeekNum=0 #week number from start of the year user to identify the week in which the build is created
found=0 #it will be 1 when we found a build that can be retained in that week
-
+
for buildname in ${allOldBuilds}; do
if [[ $buildname =~ $areNotToDelete ]]
then
@@ -98,7 +98,7 @@ for buildname in ${allOldBuilds}; do
else
buildId=$(basename $buildname) #extract buildId
yy=$(echo $buildId|cut -b2-5) #extract year from buildId
- mm=$(echo $buildId|cut -b6-7) #extract month
+ mm=$(echo $buildId|cut -b6-7) #extract month
dd=$(echo $buildId|cut -b8-9) #extract day
day=${mm}/${dd}/${yy} #construct build date
dayOfWeek=$(date -d $day +%u) #get the day of the week like monday, tue, etc
@@ -106,31 +106,29 @@ for buildname in ${allOldBuilds}; do
#special case for Sunday. unix considers sunday as the start of the week. but for us we need to consider
#monday as start of the week. For this purpose we subtract 1 to place the build in previous week
- if [ $dayOfWeek -eq 7 ]; then
+ if [ $dayOfWeek -eq 7 ]; then
weekNum=$(expr $weekNum - 1)
if [ $weekNum -le 0 ]; then #check for the yearend
weekNum=53
fi
fi
-
+
canBeRetained ${buildname}
retain=$?
if [ $weekNum -eq $currentWeekNum ]; then
if [ $retain -eq 0 -a $found -ne 1 ]; then # we didn't found a build that can be retained in the current week
found=1
- echo retaining $buildId
else
- echo removing $buildId
+ removeBuild $buildname
fi
else #week changed
currentWeekNum=$weekNum
found=0
if [ $retain -eq 0 -a $dayOfWeek -eq 1 ]; then
found=1
- echo retaining $buildId
else
- echo removing $buildId
+ removeBuild $buildname
fi
fi
fi

Back to the top