Skip to content
Snippets Groups Projects
Verified Commit 89b5d406 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Configure deployment to pypi registry

parent e89bfb24
No related branches found
No related tags found
1 merge request!55WIP: Resolve "Migrate to AlekSIS app"
Pipeline #4514 passed
include:
- project: "AlekSIS/official/AlekSIS"
file: /ci/general.yml
- project: "AlekSIS/official/AlekSIS"
file: /ci/test.yml
- project: "AlekSIS/official/AlekSIS"
file: /ci/build_dist.yml
image: registry.edugit.org/teckids/team-sysadmin/docker-images/python-pimped:latest
stages:
- test
- build
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
FF_NETWORK_PER_BUILD: "true"
POETRY_REPOSITORIES_GITLAB_URL: "$CI_API_V4_URL/projects/${CI_PROJECT_ID}/packages/pypi"
POETRY_HTTP_BASIC_GITLAB_USERNAME: ticdesk
POETRY_HTTP_BASIC_GITLAB_PASSWORD: "$TICDESK_PUBLISH_TOKEN"
POETRY_PYPI_TOKEN_PYPI: "$TICDESK_PUBLISH_TOKEN"
cache:
key:
files:
- poetry.lock
- pyproject.toml
paths:
- .cache/pip
- .tox
deploy_pypi:
stage: deploy
script:
- if [ $CI_COMMIT_REF_NAME = master ]; 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 ;
fi ;
fi
- poetry publish -r gitlab
- if [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
poetry publish -r gitlab;
fi
only:
- master
- tags
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