correct before_script for nightly build versions (#9543)
- fix gitlab array of strings syntax error - get proper commit id - avoid colon in stings
This commit is contained in:
parent
0281cca9af
commit
6e62d77e4d
@ -41,17 +41,14 @@ cache:
|
|||||||
paths:
|
paths:
|
||||||
- artifacts/
|
- artifacts/
|
||||||
|
|
||||||
.determine_version:
|
.determine_version: &determine_version
|
||||||
before_script: &determine_version
|
- VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' Cargo.toml)"
|
||||||
- >
|
- DATE_STR="$(date +%Y%m%d)"
|
||||||
VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' < Cargo.toml)";
|
- ID_SHORT="$(echo ${CI_COMMIT_SHA} | cut -c 1-7)"
|
||||||
if [ "${CI_COMMIT_REF_NAME}" = "nightly" ]; then
|
- test "${CI_COMMIT_REF_NAME}" = "nightly" && VERSION="${VERSION}-${ID_SHORT}-${DATE_STR}"
|
||||||
COMMIT_REF_SHORT="$(echo ${CI_COMMIT_REF} | grep -oE '^.{7}')";
|
- export VERSION
|
||||||
DATE_STRING="$(date +%Y%m%d)";
|
- echo "Version = ${VERSION}"
|
||||||
export VERSION="${VERSION}-${COMMIT_REF_SHORT}-${DATE_STRING}";
|
|
||||||
fi;
|
|
||||||
export VERSION;
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
|
|
||||||
|
|
||||||
#### stage: test
|
#### stage: test
|
||||||
|
Loading…
Reference in New Issue
Block a user