From 04ec120b531262736c0c0ff0d2a61560bda94bc9 Mon Sep 17 00:00:00 2001 From: Dorch <14124454+DDorch@users.noreply.github.com> Date: Fri, 5 Jan 2024 14:34:09 +0100 Subject: [PATCH] docs(ci): manual for gitlab registry usage --- DEVELOPERS.md | 6 +----- README.md | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 2194acacb..afa8c9ea3 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -31,11 +31,7 @@ La documentation est générée avec Mkdocs, pandoc et LaTeX. ### pour le développement - * nodejs / npm - * python (pour mkdocs) - * wine (pour Electron / windows) - * pandoc (pour la documentation PDF) - * une distribution LaTeX, par exemple texlive (pour la documentation PDF) +Voir la section *Requirements* du fichier `README.md`. ### pour l'exécution diff --git a/README.md b/README.md index d1e1d3b2d..5a3ea5e0f 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ sudo apt install pandoc texlive latexmk texlive-latex-extra texlive-bibtex-extra #### Using docker container -Download and use the following docker image: https://hub.docker.com/repository/docker/geaucassiopee/ci-cd-cross-platform-webapp - -More details on how to use it on vscode are available at https://forgemia.inra.fr/cassiopee/cassiopee2-integration +Use the DockerFile provided at the root of this repository. This repository also +provide a `.devcontainer` configuration for developing nghyd in vscode +(See https://code.visualstudio.com/docs/devcontainers/containers). ### Install dependencies @@ -206,7 +206,38 @@ To draw the diagram: npm run viz ``` -## Caveats +### CI/CD docker image + +Gitlab CI/CD uses a docker image created with the `DockerFile` located at the root +of this repository. This image needs to be pushed on the Gitlab registry in order to +be used by the CI/CD. + +#### Requirements + +You need to have Docker installed on your computer (See: https://docs.docker.com/get-docker/). +On Windows, you first need to install a Linux distro under WSL2 (See +https://learn.microsoft.com/en-us/windows/wsl/install). + +#### Build and push container images to the Container Registry + +This notice is inspired from +https://docs.gitlab.com/ee/user/packages/container_registry/build_and_push_images.html. + +You first need to create an access token (personal or project token): + +Go to https://gitlab.irstea.fr/-/profile/personal_access_tokens +and create a token with a minimum scope `write_registry` and `read_registry`. + +Open a terminal in the root folder of this repository on your local machine, +and type (with `<token name>` and `<token value>` the credentials +of the access token): + +``` +docker login registry.forgemia.inra.fr -u <token name> -p <token value> +docker build -t registry.forgemia.inra.fr/cassiopee/nghyd . +docker push registry.forgemia.inra.fr/cassiopee/nghyd +``` + ### Deployment -- GitLab