diff options
author | Ryan Harkin <ryan.harkin@linaro.org> | 2017-08-01 18:13:43 +0100 |
---|---|---|
committer | Ryan Harkin <ryan.harkin@linaro.org> | 2017-08-01 18:13:43 +0100 |
commit | 9f77e8c0a0bb916c7cd96ceceeae6bf2478089ae (patch) | |
tree | 531b7e76b13d34cfb77c2a38eaf76b2a85305bee | |
parent | 118c527f99f5c77ec40f33104ea6aa0685e9c639 (diff) |
platforms-ci.sh: add smart release date check
If we are releasing at the start of a month, that almost always because
we're making the previous month's release late.
So if it's the start of a month, use the previous month's date as the
release marker.
I used 15th of the month as the cut-off point. From the 15th onwards, we
assume we're making the release early.
Eg. if it's 14th August 2017, use 17.07
if it's 15th August 2017, use 17.08
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
-rwxr-xr-x | platforms-ci.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/platforms-ci.sh b/platforms-ci.sh index 505ffc1..b944c22 100755 --- a/platforms-ci.sh +++ b/platforms-ci.sh @@ -27,7 +27,23 @@ unset WORKSPACE case "$1" in "release" ) JOB_TYPE=release - YYMM=`date +%y`.`date +%m` + + Y=`date +%-y` + M=`date +%-m` + D=`date +%-d` + # if the release is being made at the start of the month + # we assume we're making the previous month's release late + if [ "${D}" -lt "15" ]; then + # check if we need to wrap to the previous year + if [ "$M" == "1" ]; then + M=11 + ((Y--)) + else + ((M--)) + fi + fi + YYMM=`printf "%02d.%02d" $Y $M` + echo Building release $YYMM PINNED="pinned-" ;; |