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

Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found

Cible

Sélectionner le projet cible
  • geoplateforme/scripts-verification/check-md5
1 résultat
Afficher les modifications
Validations sur la source (16)
**/__pycache__
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitlab
**/.github
**/.gitignore
**/.project
**/.pytest_cache
**/.settings
**/.toolstarget
**/.venv
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/htmlcov
**/docker-compose*
**/Dockerfile*
**/junit
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/site
# **/tests
**/values.dev.yaml
# custom project
docs/
build/
dist/
tests/
**/*.xml
stages:
- 🐍 lint
- 🤞 test
- 📦 build
- 🚀 deploy
- lint
- test
- build
- deploy
# Templates
include:
- template: Security/SAST.gitlab-ci.yml
# - project: geoplateforme/templates
# ref: main
# file:
# - "/ci/sonarqube.yml"
- project: geoplateforme/templates
ref: main
file:
- "/ci/docker.yml"
- "/ci/dependency-track.yml"
- "/ci/sonarqube.yml"
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PROJECT_FOLDER: "src"
DOCKER_IMG_NAME: "gpf-md5-checker"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
......@@ -32,7 +35,7 @@ cache:
# -- LINT JOBS -------------------------------------------------------------------------
git-hooks:
stage: 🐍 lint
stage: lint
image: python:3.9
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
......@@ -53,7 +56,7 @@ git-hooks:
- pre-commit run --from-ref "origin/$CI_DEFAULT_BRANCH" --to-ref "$CI_COMMIT_SHA";
flake8:
stage: 🐍 lint
stage: lint
image: python:3.9-slim-buster
only:
changes:
......@@ -66,11 +69,11 @@ flake8:
# -- TEST JOBS --------------------------------------------------------------------------
sast:
stage: 🤞 test
stage: test
# -- TEST JOBS --------------------------------------------------------------------------
test-unit:
stage: 🤞 test
test:
stage: test
image: python:3.9-slim-buster
only:
changes:
......@@ -92,8 +95,8 @@ test-unit:
coverage_format: cobertura
path: coverage.xml
test-documentation:
stage: 🤞 test
test:documentation:
stage: test
image: python:3.9-slim-buster
only:
changes:
......@@ -114,8 +117,8 @@ test-documentation:
when: always
# -- BUILD JOBS -------------------------------------------------------------------------
packaging-pip:
stage: 📦 build
build:pip-wheel:
stage: build
image: python:3.9-slim-buster
only:
refs:
......@@ -128,11 +131,11 @@ packaging-pip:
- python setup.py sdist bdist_wheel
artifacts:
paths:
- .pypirc # required by job gitlab-pypi-package
- .pypirc # required by job gitlab:pypi
- dist/*
documentation:
stage: 📦 build
build:documentation:
stage: build
image: python:3.9-slim-buster
only:
refs:
......@@ -150,8 +153,8 @@ documentation:
when: always
# -- DEPLOYMENT JOBS -------------------------------------------------------------------
gitlab-pypi-package:
stage: 🚀 deploy
gitlab:pypi:
stage: deploy
image: python:3.9-slim-buster
variables:
GIT_STRATEGY: none
......@@ -159,7 +162,7 @@ gitlab-pypi-package:
TWINE_USERNAME: "gitlab-ci-token"
TWINE_REPOSITORY_URL: "https://gitlab.gpf-tech.ign.fr/api/v4/projects/${CI_PROJECT_ID}/packages/pypi"
needs:
- job: packaging-pip
- job: build:pip-wheel
artifacts: true
only:
- tags
......@@ -172,16 +175,16 @@ gitlab-pypi-package:
- python -m twine upload --verbose dist/*
release_job:
stage: 🚀 deploy
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
variables:
GIT_STRATEGY: none
only:
- tags
needs:
- job: packaging-pip
- job: build:pip-wheel
artifacts: true
- job: gitlab-pypi-package
- job: gitlab:pypi
artifacts: false
script:
- echo "Creating release from $CI_COMMIT_TAG"
......@@ -190,7 +193,7 @@ release_job:
description: "$CI_COMMIT_TAG"
pages:
stage: 🚀 deploy
stage: deploy
variables:
GIT_STRATEGY: none
only:
......@@ -203,7 +206,7 @@ pages:
- main
- tags
needs:
- documentation
- build:documentation
script:
- mkdir -p public
# copy HTML documentation
......
......@@ -16,6 +16,13 @@ Unreleased
-->
## 0.3.0 - 2022-11-22
- CI: enable Sonarube analysis
- CI: enable dependency track
- CD: package as Docker image and publish to container registry
- documentation: small improvements
## 0.2.0 - 2022-11-18
- Use argparse to expose a robust CLI
......
FROM python:3.11-slim
# Write .pyc files only once. See: https://stackoverflow.com/a/60797635/2556577
ENV PYTHONDONTWRITEBYTECODE 1
# Make sure that stdout and stderr are not buffered. See: https://stackoverflow.com/a/59812588/2556577
ENV PYTHONUNBUFFERED 1
# Remove assert statements and any code conditional on __debug__. See: https://docs.python.org/3/using/cmdline.html#cmdoption-O
ENV PYTHONOPTIMIZE 2
WORKDIR /user/app
COPY requirements.txt .
COPY requirements/base.txt ./requirements/
RUN python -m pip install --no-cache-dir -U pip && \
python -m pip install --no-cache-dir -U setuptools wheel
COPY . .
RUN python -m pip install -U --no-cache-dir -r requirements.txt
RUN python -m pip install -U -e .
CMD ["bash"]
......@@ -30,6 +30,9 @@ version = release = __about__.__version__
#
# needs_sphinx = '1.0'
# Make sure the target is unique
autosectionlabel_prefix_document = True
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
......@@ -42,7 +45,6 @@ extensions = [
"sphinx.ext.intersphinx",
# 3rd party
"myst_parser",
# "sphinxarg.ext",
"sphinx_argparse_cli",
"sphinx_copybutton",
"sphinxext.opengraph",
......@@ -67,7 +69,7 @@ master_doc = "index"
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
# language = "fr"
language = "fr"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
......@@ -139,14 +141,17 @@ intersphinx_mapping = {
myst_enable_extensions = [
"colon_fence",
"deflist",
"dollarmath",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
]
myst_heading_anchors = 3
# replacement variables
myst_substitutions = {
"author": author,
......
......@@ -50,4 +50,36 @@ Il est aussi possible d'utiliser le [registre lié au projet](https://gitlab.gpf
## Docker
> Bientôt dans vos documentations
:::{note}
L'image est configurée à des fins d'**utilisation** et non à des fins de développement.
A ce titre l'image ne contient que le code source et le nécessaire pour installer le programme. Donc, il n'y a pas les dossiers `docs`, `tests`, etc.
Si besoin, ajuster le fichier `.dockerignore`.
:::
### Prérequis
- Docker >= 20.10
### Builder l'image
```sh
docker build --pull --rm -f "Dockerfile" -t gpf-md5-checker:latest "."
```
### Exécuter l'image dans un conteneur
Entrer dans le conteneur et exécuter des commandes de façon interactive :
```sh
> docker run --rm -it gpf-md5-checker:latest
root@55c5de0191ee:/user/app# gpf-md5-checker --version
0.2.0
```
Exécuter le programme dans le conteneur :
```sh
> docker run --rm checkmd5:latest gpf-md5-checker --version
0.2.0
```
......@@ -40,7 +40,7 @@ __uri_repository__ = (
__uri_tracker__ = "https://gitlab.gpf-tech.ign.fr/geoplateforme/scripts-verification/check-md5/issues/"
__uri__ = __uri_repository__
__version__ = "0.2.0"
__version__ = "0.3.0"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
......