Commit dfada042 authored by Manuel Moos's avatar Manuel Moos
Browse files

Determine release year in CI_INFO

None of the information sources we need are available at deployment
parent f4b162b9
Pipeline #232567369 passed with stages
in 34 minutes and 31 seconds
......@@ -111,6 +111,7 @@ CI_INFO: ${srcdir}/../scripts/brand.sh
echo PROGRAM_TITLE=$${PROGRAM_TITLE} >> $@ && \
echo CI_COMMIT_REF_PROTECTED=$${CI_COMMIT_REF_PROTECTED} >> $@ && \
echo CI_COMMIT_SHA=$${CI_COMMIT_SHA} >> $@ && \
echo CI_RELEASE_YEAR=$${CI_RELEASE_YEAR} >> $@ && \
echo CI_COMMIT_REF_NAME=$${CI_COMMIT_REF_NAME} >> $@
.PRECIOUS: CI_INFO
......
......@@ -7,6 +7,7 @@ SERIES=`cat CI_INFO | grep SERIES= | sed -e s/^SERIES=//` || exit $?
CI_COMMIT_REF_PROTECTED=`cat CI_INFO | grep CI_COMMIT_REF_PROTECTED= | sed -e s/^CI_COMMIT_REF_PROTECTED=//` || exit $?
CI_COMMIT_SHA=`cat CI_INFO | grep CI_COMMIT_SHA= | sed -e s/^CI_COMMIT_SHA=//` || exit $?
CI_COMMIT_REF_NAME=`cat CI_INFO | grep CI_COMMIT_REF_NAME= | sed -e s/^CI_COMMIT_REF_NAME=//` || exit $?
YEAR=`cat CI_INFO | grep CI_RELEASE_YEAR= | sed -e s/^CI_RELEASE_YEAR=//` || exit $?
# if staging is true, hold back release
if test "${STAGING}" != "false"; then
......@@ -17,13 +18,6 @@ fi
test -z ${SERIES} && exit 1
test -z ${SUFFIX} && exit 1
if test -r @top_srcdir@/timestamp.tag; then
YEAR=`date -r @top_srcdir@/timestamp.tag +%Y` || exit $?
else
unix_date=`git -C @top_srcdir@ log -1 --format=%at` || exit $?
YEAR=`date --date=@${unix_date} +%Y` || exit $?
fi
case ${SERIES}+${SUFFIX}+@version@ in
CURRENT+armagetronad+*_rc_*)
SF_DIR="rc/${YEAR}"
......
......@@ -18,6 +18,11 @@ if test -z "${CI_DEFAULT_BRANCH}" || test -z "${CI_COMMIT_REF_PROTECTED}"; then
CI_MERGE_REQUEST_ID=
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME=
CI_MERGE_REQUEST_TARGET_BRANCH_NAME=
unix_date=`git -C ${git_repo} log -1 --format=%at` || exit $?
CI_RELEASE_YEAR=`date --date=@${unix_date} +%Y` || exit $?
else
# CI_COMMIT_TIMESTAMP is of the form 2020-12-21T02:13:17+01:00
CI_RELEASE_YEAR=`echo ${CI_COMMIT_TIMESTAMP} | sed -e "s/-.*//"` || exit $?
fi
if test "${CI_COMMIT_REF_PROTECTED}" = "true"; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment