Add check for open source release freshness.
@@ -70,3 +70,41 @@ jobs:
du -sh /tmp/vespa/*
ls -la /main_job_cache || true
df -h
+
+ verify-opensource-release-7days:
+ requires: [~pr, ~commit]
+ image: vespaengine/vespa-pipeline
+ environment:
+ USER_SHELL_BIN: bash
+ annotations:
+ screwdriver.cd/buildPeriodically: H 0 * * *
+ steps:
+ - now-epoch: |
+ now_epoch=`date "+%s"`
+ echo "Now epoch: " $now_epoch
+ - calculate-current-release-age: |
+ current_release_date=`curl -s 'https://repo1.maven.org/maven2/com/yahoo/vespa/parent/' | \
+ grep '^<a href="[0-9]' | awk '{print $4}' | sort | tail -1`
+ echo "Current release date: " $current_release_date
+ current_release_epoch=`date -d "$current_release_date" "+%s"`
+ echo "Current release epoch: " $current_release_epoch
+ release_age_days=$((($now_epoch-$current_release_epoch)/86400))
+ echo "Release age days: " $release_age_days
+ - error-if-current-release-too-old: |
+ if [ "$release_age_days" -gt 7 ]; then
+ echo "Current open source release is older than 7 days"
+ exit 1
+ fi
+ - calculate-docker-image-age: |
+ image_date=`curl https://hub.docker.com/v2/repositories/vespaengine/vespa/ | \
+ python -m json.tool| grep last_updated | awk '{print $2}' | tr -d '",'`
+ echo "Docker image last_updated: " $image_date
+ image_epoch=`date -d "$image_date" "+%s"`
+ echo "Docker image epoch: " $image_epoch
+ docker_image_age_days=$((($now_epoch-$image_epoch)/86400))
+ echo "Docker image age days: " $docker_image_age_days
+ - error-if-docker-image-too-old: |
+ if [ "$docker_image_age_days" -gt 7 ]; then
+ echo "Current Docker image is older than 7 days"
+ exit 1
+ fi
