From d1f092b1a45976d8af066174bb03732b01572c59 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 2 Jul 2021 17:08:52 -0700 Subject: [PATCH] create a python publish set with cic-base --- .gitlab-ci.yml | 2 +- apps/cic-base/.gitlab-ci.yml | 26 ++++++++++++++++++++++++++ ci_templates/.cic-template.yml | 14 +++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 apps/cic-base/.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52f8ffd6..d9af2223 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,4 +11,4 @@ include: stages: - build - test - - release + - publish diff --git a/apps/cic-base/.gitlab-ci.yml b/apps/cic-base/.gitlab-ci.yml new file mode 100644 index 00000000..a99a5a24 --- /dev/null +++ b/apps/cic-base/.gitlab-ci.yml @@ -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 diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index a1bd4c8f..c7c36f45 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -46,4 +46,16 @@ variables: 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/*