Skip to content
Snippets Groups Projects
Commit 96c4ff71 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'ci-commit-timestamp' into 'master'

Use CI_COMMIT_TIMESTAMP instead of date %s.

See merge request AlekSIS/official/AlekSIS!388
parents 7ba7e7d9 8bb8dd47
No related branches found
No related tags found
1 merge request!388Use CI_COMMIT_TIMESTAMP instead of date %s.
Pipeline #4371 failed
build_dist: build_dist:
stage: build stage: build
script: script:
- if [ $CI_COMMIT_REF_NAME = master ]; then - if ! [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ; poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ;
elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then
echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ;
exit 1 ;
fi ;
fi fi
- tox -e build - tox -e build
artifacts: artifacts:
paths: paths:
- dist/ - dist/
only:
- master
- tags
...@@ -2,8 +2,8 @@ deploy_pypi: ...@@ -2,8 +2,8 @@ deploy_pypi:
stage: deploy stage: deploy
script: script:
- if [ $CI_COMMIT_REF_NAME = master ]; then - if [ $CI_COMMIT_REF_NAME = master ]; then
poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ; poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ;
elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then
echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ; echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ;
exit 1 ; exit 1 ;
...@@ -11,7 +11,7 @@ deploy_pypi: ...@@ -11,7 +11,7 @@ deploy_pypi:
fi fi
- if [ $CI_COMMIT_REF_NAME = master ]; then - if [ $CI_COMMIT_REF_NAME = master ]; then
poetry publish -r gitlab ; poetry publish -r gitlab ;
elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
poetry publish ; poetry publish ;
fi fi
only: only:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment