aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2017-08-01 18:13:43 +0100
committerRyan Harkin <ryan.harkin@linaro.org>2017-08-01 18:13:43 +0100
commit9f77e8c0a0bb916c7cd96ceceeae6bf2478089ae (patch)
tree531b7e76b13d34cfb77c2a38eaf76b2a85305bee
parent118c527f99f5c77ec40f33104ea6aa0685e9c639 (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-xplatforms-ci.sh18
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-"
;;