create a python publish set with cic-base

This commit is contained in:
Blair Vanderlugt 2021-07-02 17:08:52 -07:00
parent 0cd68939ba
commit d1f092b1a4
3 changed files with 40 additions and 2 deletions

View File

@ -11,4 +11,4 @@ include:
stages: stages:
- build - build
- test - test
- release - publish

View File

@ -0,0 +1,26 @@
.cic_base_variables:
variables:
APP_NAME: cic-base
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
.cic_base_changes_target:
rules:
- changes:
- $CONTEXT/$APP_NAME/*
build-mr-cic-base:
extends:
- .cic_base_changes_target
- .py_build_merge_request
- .cic_base_variables
build-push-cic-cache:
extends:
- .py_build_push
- .cic_base_variables
publish_python:
extends:
- .publish_python
- .cic_base_variables

View File

@ -46,4 +46,16 @@ variables:
when: always when: always
.publish_python:
image: registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev
stage: publish
variables:
#CI_DEBUG_TRACE: "true"
CIC_PACKAGE_REGISTRY_PROJECT_ID: 27624814
script:
- python -m pip wheel --extra-index-url https://pip.grassrootseconomics.net:8433 --wheel-dir=/tmp/wheelhouse -r requirements.txt
- python -m pip install --no-index --find-links=/tmp/wheelhouse -r requirements.txt
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CIC_PACKAGE_REGISTRY_PROJECT_ID}/packages/pypi dist/*
# Below are the built dependencies
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CIC_PACKAGE_REGISTRY_PROJECT_ID}/packages/pypi /tmp/wheelhouse/*