summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-gs-cleanup.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-05-26 00:39:18 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2016-05-26 00:39:18 +0200
commitb417f69a136a032a3a6f6075abecb7b10ed64167 (patch)
tree041bdd52826b44409c2d68d3088ea324a36fb9de /jjb/apex/apex-gs-cleanup.sh
parentce4601a1ddc92b32afeef181644fdab09287d948 (diff)
apex: Take builders out of jjb
Having builders embedded in jjb makes maintenance harder than what it could be and error prone so the builders have been taken out. Apart from this, the upcoming change proposals will split yml files in 2, aligning with the rest and jobs in these files can reuse same builders when they are converted in shell scripts. This is the first change in series, trying to align job structure with the rest in order to ease the effort required to troubleshoot the deployments during release verification. The changes are - take builders out of jjb (this patch) - align the main CI jobs with the rest; 1 parent job per scenario/branch which controls triggering and execution of 3 downstream jobs; deploy, yardstick, functest - split yml file in 2; ci jobs ending in apex-ci-jobs.yml (daily) and project jobs ending in apex-project-jobs.yml. (verify, merge, build) Change-Id: I01f8bf351f0cbafbee1f41ec24ad5c2c6f21316f Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/apex/apex-gs-cleanup.sh')
-rwxr-xr-xjjb/apex/apex-gs-cleanup.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/jjb/apex/apex-gs-cleanup.sh b/jjb/apex/apex-gs-cleanup.sh
new file mode 100755
index 000000000..1629aa85e
--- /dev/null
+++ b/jjb/apex/apex-gs-cleanup.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# log info to console
+echo "Cleaning Google Storage"
+echo "-----------------------"
+echo
+
+thirty_days_ago=$(date -d "30 days ago" +"%Y%m%d")
+
+for i in $(gsutil ls gs://$GS_URL/*201?*); do
+ filedate=$(date -d "$(echo $i | grep -Eo 201[0-9]-?[0-9][0-9]-?[0-9][0-9])" +"%Y%m%d")
+ if [ $filedate -lt $thirty_days_ago ]; then
+ # gsutil indicates what it is removing so no need for output here
+ gsutil rm $i
+ fi
+done