Voici la documentation : https://geoplateforme.pages.gpf-tech.ign.fr/documentation

Skip to content
Extraits de code Groupes Projets

CI : ajoute les jobs pour générer les release notes automatiquement à partir du git log et MAJ de routine

Fusionnées Julien Moura a demandé de fusionner ci/add-auto-release-notes-job vers main
1 fichier
+ 53
16
Comparer les modifications
  • Côte à côte
  • En ligne
+ 53
16
@@ -16,7 +16,7 @@ include:
file:
- "/ci/docker-v4.yml"
- "/ci/dependency-track.yml"
- "ci/pre-commit-v1.yml"
- "/ci/pre-commit-v1.yml"
- "/ci/sonarqube.yml"
# Change pip's cache directory to be inside the project directory since we can
@@ -28,6 +28,7 @@ variables:
PIP_EXTRA_INDEX_URL: https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_API_V4_URL}/groups/55/-/packages/pypi/
PIP_PROGRESS_BAR: "off"
PIP_RETRIES: 0
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
PROJECT_FOLDER: "gpf_pyroger"
PYTHON_VERSION: "3.9"
@@ -41,12 +42,13 @@ cache:
files:
- requirements/*.txt
paths:
- .cache/pip
- ${PIP_CACHE_DIR}
- ${PRE_COMMIT_HOME}
# -- LINT JOBS -------------------------------------------------------------------------
flake8:
stage: lint
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
only:
changes:
- "**/*.py"
@@ -63,12 +65,11 @@ sast:
# -- TEST JOBS --------------------------------------------------------------------------
test:
stage: test
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
before_script:
- python3 -m pip install -U -r requirements.txt
- python3 -m pip install -U -r requirements/base.txt
- python3 -m pip install -e .
- python3 -m pip install -U -r requirements/testing.txt
- python3 -m pip install -e .
script:
- pytest
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
@@ -86,7 +87,7 @@ test:
# -- BUILD JOBS -------------------------------------------------------------------------
build:pip-wheel:
stage: build
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
only:
refs:
- main
@@ -101,9 +102,9 @@ build:pip-wheel:
- .pypirc # required by job gitlab:pypi
- dist/*
build:documentation:licenses:
build:documentation:credits:
stage: build
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
only:
refs:
- main
@@ -117,24 +118,34 @@ build:documentation:licenses:
- echo -e "\`\`\`{mermaid}" > docs/misc/dependencies.md
- pipdeptree --exclude pip,pipdeptree,pip-licenses,prettytable,setuptools,wheel --mermaid >> docs/misc/dependencies.md
- echo -e "\`\`\`" >> docs/misc/dependencies.md
- pip-licenses --format=markdown --with-authors --with-description --with-urls --output-file=docs/misc/licenses.md
- pip-licenses --format=markdown --with-authors --with-description --with-urls --ignore-packages pip,pipdeptree,prettytable,setuptools,wheel --output-file=docs/misc/licenses.md
artifacts:
name: doc_autogenerated
expose_as: Dependencies
expose_as: Credits
paths:
- docs/misc/dependencies.md
- docs/misc/licenses.md
when: always
build:documentation:
stage: build
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
only:
refs:
- main
- tags
needs:
- job: build:documentation:licenses
- job: build:documentation:credits
artifacts: true
cache:
key:
files:
- requirements/documentation.txt
prefix: $CI_JOB_NAME
paths:
- "docs/_build/cache"
untracked: true
when: "on_success"
before_script:
- python -m pip install -U -r requirements/base.txt
- python -m pip install -U -r requirements/documentation.txt
@@ -151,7 +162,7 @@ build:documentation:
# -- DEPLOYMENT JOBS -------------------------------------------------------------------
gitlab:pypi:
stage: deploy
image: ${DOCKERHUB_PROXY}/library/python:3.9-slim-bullseye
image: ${DOCKERHUB_PROXY}/library/python:${PYTHON_VERSION}-slim-bullseye
variables:
GIT_STRATEGY: none
TWINE_PASSWORD: "${CI_JOB_TOKEN}"
@@ -170,7 +181,26 @@ gitlab:pypi:
- python -m twine check dist/*
- python -m twine upload --verbose dist/*
release_job:
release:prepare:
stage: deploy
image:
name: ${DOCKERHUB_PROXY}/alpine/git:latest
entrypoint: [""]
only:
- tags
allow_failure: true
script:
- echo -e '## Changelog\n' >> RELEASE_DESCRIPTION.md
- git tag -l -n9 $CI_COMMIT_TAG >> RELEASE_DESCRIPTION.md
- echo -e '\n### Merges\n' >> RELEASE_DESCRIPTION.md
- git log --merges --pretty="- %s (%h)" $(git tag --sort=-creatordate | head -2)...$(git tag --sort=-creatordate | head -1) >> RELEASE_DESCRIPTION.md
- echo -e '\n### AUTHORS\n' >> RELEASE_DESCRIPTION.md
- git log --pretty="- %an%n- %cn" $(git tag --sort=-creatordate | head -2)...$(git tag --sort=-creatordate | head -1) | sort | uniq >> RELEASE_DESCRIPTION.md
artifacts:
paths:
- RELEASE_DESCRIPTION.md
release:publish:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
variables:
@@ -182,11 +212,18 @@ release_job:
artifacts: true
- job: gitlab:pypi
artifacts: false
- job: release:prepare
artifacts: true
script:
- echo "Creating release from $CI_COMMIT_TAG"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
description: RELEASE_DESCRIPTION.md
name: $CI_COMMIT_TAG
tag_name: "$CI_COMMIT_TAG"
description: "$CI_COMMIT_TAG"
artifacts:
paths:
- RELEASE_DESCRIPTION.md
expire_in: never
pages:
stage: deploy
Chargement en cours