-
Notifications
You must be signed in to change notification settings - Fork 609
64 lines (52 loc) · 1.99 KB
/
verify-opensource-release-7days.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: verify-opensource-release-7days
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/verify-opensource-release-7days.yml
branches:
- master
push:
paths:
- .github/workflows/verify-opensource-release-7days.yml
branches:
- master
- glebashnik/gh-action-verify-opensource-release-7days
schedule:
- cron: '0 0 * * *'
jobs:
error-if-current-release-too-old:
runs-on: ubuntu-latest
steps:
- name: error-if-current-release-too-old
run: |
now_epoch=`date "+%s"`
echo "Now epoch: " $now_epoch
current_release_date=$(curl -sLf https://repo1.maven.org/maven2/com/yahoo/vespa/cloud-tenant-base/maven-metadata.xml | \
grep -oP "<lastUpdated>\K\w+" | cut -c 1-8)
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
if [ "$release_age_days" -gt 7 ]; then
echo "Current open source release is older than 7 days"
exit 1
fi
error-if-docker-image-too-old:
runs-on: ubuntu-latest
steps:
- name: error-if-docker-image-too-old
run: |
now_epoch=`date "+%s"`
echo "Now epoch: " $now_epoch
image_date=$(curl -sLf https://hub.docker.com/v2/repositories/vespaengine/vespa/ | jq -re '.last_updated')
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
if [ "$docker_image_age_days" -gt 7 ]; then
echo "Current Docker image is older than 7 days"
exit 1
fi