Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7ba07d75 authored by Raphael JOIE's avatar Raphael JOIE
Browse files

Merge branch 'publish-pipeline-dry-run' into 'main'

Publish pipeline dry run

See merge request !16
parents 47b9bf69 f2e548c7
No related branches found
Tags v2.0 v2.0.0
1 merge request!16Publish pipeline dry run
Pipeline #149537 waiting for manual action
......@@ -105,3 +105,9 @@ build-and-publish-package:
- lab
variables:
PROJECT_PATH: boilerplate
DRY_RUN: "no"
rules:
- changes:
- boilerplate/**/*
when: always
- when: manual
......@@ -89,14 +89,20 @@ stages:
include:
- project: 'digit-c4/dev/python-best-practices'
file: 'gitlab-ci/build-and-publish-package.yml'
ref: v1.0
ref: v2.0
build-and-publish-package:
stage: build
tags:
- docker
variables:
#PROJECT_PATH: "./"
# path to the project root (default is git root)
# PROJECT_PATH: "./"
# perform a dry run "yes" (default) or "no". Mind the quotes as YAML parses yes
# as boolean, and Gitlab only expects String for variables.
# IMPORTANT: must be specified for actual publishing as default value is "no"
# DRY_RUN: "yes"
```
### **Ensures** Python style
......
......@@ -7,4 +7,12 @@ build-and-publish-package:
- poetry build
- poetry config repositories.gitlab "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/pypi"
- poetry config http-basic.gitlab gitlab-ci-token "$CI_JOB_TOKEN"
- poetry publish --repository gitlab
- echo ${DRY_RUN:=yes}
- |
if [[ "${DRY_RUN:=yes}" == "no" ]]
then
poetry publish --repository gitlab
else
echo "This is a dry run and nothing will actually be uploaded"
poetry publish --dry-run --repository gitlab
fi
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