diff options
author | Tim Rozet <trozet@redhat.com> | 2016-04-28 19:12:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-04-28 19:12:50 +0000 |
commit | be56f9bb69c476c3235e6fca2f4cec6e230ae8f1 (patch) | |
tree | 57dd392744fb418ec6d15af53b3b1ee17d6da27d /jjb/apex | |
parent | ade767845f031934fd2150efb53e6a976ca4e1de (diff) | |
parent | 2930fff5e8484dbd53e70f64e7e60daf6430471a (diff) |
Merge "Adding GS clenaup for Apex"
Diffstat (limited to 'jjb/apex')
-rw-r--r-- | jjb/apex/apex.yml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 26090a3a3..6dbea1a62 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -628,6 +628,30 @@ failure-threshold: 'never' unstable-threshold: 'FAILURE' +- job-template: + name: 'apex-gs-clean-{stream}' + + # Job template for clean + # + # Required Variables: + # stream: branch with - in place of / (eg. stable) + node: '{slave}' + + disabled: false + + parameters: + - project-parameter: + project: '{project}' + - apex-parameter: + gs-pathname: '{gs-pathname}' + + builders: + - 'apex-gs-clean' + + triggers: + - 'apex-gs-clean-{stream}' + + ######################## # parameter macros ######################## @@ -780,6 +804,30 @@ echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)" - builder: + name: 'apex-gs-cleanup' + builders: + - shell: | + #!/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 + +- builder: name: 'apex-deploy-virtual' builders: - shell: | @@ -1010,3 +1058,7 @@ name: 'apex-brahmaputra' triggers: - timed: '0 3 * * *' +- trigger: + name: 'apex-gs-clean-{stream}' + triggers: + - timed: '0 2 * * *' |