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:
stage: build
script:
- if [ $CI_COMMIT_REF_NAME = master ]; then
poetry version $(poetry version | cut -d" " -f2)+$(date +%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 ;
- if ! [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ;
fi
- tox -e build
artifacts:
paths:
- dist/
only:
- master
- tags
......@@ -2,8 +2,8 @@ deploy_pypi:
stage: deploy
script:
- if [ $CI_COMMIT_REF_NAME = master ]; then
poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ;
elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
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_COMMIT_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 ;
......@@ -11,7 +11,7 @@ deploy_pypi:
fi
- if [ $CI_COMMIT_REF_NAME = master ]; then
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 ;
fi
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