diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e979801fbd2aed35878d7695c000ff3340e06e32..9946bf79b2f837826abe5f585e8ae24d42d6b799 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,16 @@ image: docker:24 -build: + +stages: + - "📦 build" + - "🩺 test" + - "🚀 deploy" + - "🔧 configure" + + +"🳠build": needs: [] - stage: build + stage: "📦 build" variables: RUN_TEST: "1" POSTGRES_HOST: "db-test" @@ -59,9 +67,9 @@ build: -test-file-perms: - stage: test - needs: ["build"] +"🩺 test-file-perms": + stage: "🩺 test" + needs: ["🳠build"] variables: FILEPATH_TO_TEST: "/code/manage.py" PATH_TAG: "app" @@ -81,8 +89,8 @@ test-file-perms: .deploy: - needs: ["build", "tailored-doc"] - stage: deploy + needs: ["🳠build", "📠tailored-doc"] + stage: "🚀 deploy" image: harbor.pasteur.fr/kube-system/helm-kubectl:3.13.3 variables: CI_DEBUG_TRACE: "false" @@ -93,7 +101,7 @@ test-file-perms: environment: name: "k8sdev-01-strass-dev/$CI_COMMIT_REF_SLUG" url: "https://strass-${CI_COMMIT_REF_SLUG}.dev.pasteur.cloud" - on_stop: stop_and_delete_in_dev + on_stop: "💥 stop_and_delete_in_dev" script: - kubectl delete secret registry-gitlab -n $NAMESPACE --ignore-not-found=true - kubectl create secret docker-registry -n $NAMESPACE registry-gitlab --docker-server=$CI_REGISTRY --docker-username=$DEPLOY_USER --docker-password=$DEPLOY_TOKEN --docker-email=$GITLAB_USER_EMAIL @@ -123,7 +131,7 @@ test-file-perms: -deploy_dev: +"🚀 deploy_dev": extends: .deploy except: variables: @@ -131,8 +139,12 @@ deploy_dev: -deploy_prod: +"🚀 deploy_prod": extends: .deploy + needs: + - "🳠build" + - "📠tailored-doc" + - "💯 checkCoverageMasterOrProd" only: variables: - $CI_COMMIT_REF_SLUG =~ /-prod$/ @@ -144,32 +156,34 @@ deploy_prod: environment: name: "k8sprod-02/strass-prod/$CI_COMMIT_REF_SLUG" url: "https://${CI_COMMIT_REF_SLUG::-5}.pasteur.cloud" - on_stop: stop_and_delete_in_prod + on_stop: "â—💥 stop_and_delete_in_prod" before_script: - export REL_NAME="${CI_COMMIT_REF_SLUG::-5}" -open_public_access: - needs: ["deploy_prod"] +"🔓🌠open_public_access": + needs: ["🚀 deploy_prod"] + stage: "🔧 configure" when: manual - extends: deploy_prod + extends: "🚀 deploy_prod" variables: PUBLICLY_OPEN: "true" -close_public_access: - needs: ["deploy_prod"] +"🔒🌠close_public_access": + needs: ["🚀 deploy_prod"] + stage: "🔧 configure" when: manual - extends: deploy_prod + extends: "🚀 deploy_prod" variables: PUBLICLY_OPEN: "false" .stop_and_delete: - stage: deploy + stage: "🔧 configure" when: manual image: harbor.pasteur.fr/kube-system/helm-kubectl:3.13.3 variables: @@ -186,8 +200,8 @@ close_public_access: -stop_and_delete_in_dev: - needs: ["deploy_dev"] +"💥 stop_and_delete_in_dev": + needs: ["🚀 deploy_dev"] extends: .stop_and_delete except: variables: @@ -195,13 +209,13 @@ stop_and_delete_in_dev: -stop_and_delete_in_prod: - needs: ["deploy_prod"] +"â—💥 stop_and_delete_in_prod": + needs: ["🚀 deploy_prod"] extends: .stop_and_delete only: variables: - $CI_COMMIT_REF_SLUG =~ /-prod$/ - stage: deploy + stage: "🔧 configure" when: manual variables: GIT_STRATEGY: none # important to not checkout source when branch is deleted @@ -217,10 +231,10 @@ stop_and_delete_in_prod: -build_pages: +"📠build_pages": needs: [] image: python:3.11 - stage: build + stage: "📦 build" script: - pip install -r doc/requirements.txt - cd doc @@ -233,8 +247,8 @@ build_pages: pages: - needs: [build_pages] - stage: build + needs: ["📠build_pages"] + stage: "📦 build" script: - ls -lah artifacts: @@ -245,9 +259,9 @@ pages: -tailored-doc: - needs: [build_pages] - stage: build +"📠tailored-doc": + needs: ["📠build_pages"] + stage: "📦 build" before_script: - i=0; while [ "$i" -lt 60 ]; do docker info && break; sleep 1; i=$(( i + 1 )) ; done - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin @@ -282,10 +296,10 @@ tailored-doc: -black: +"🎨 black": needs: [] image: python:3.11 - stage: build + stage: "📦 build" script: - python -m pip install --upgrade pip - cd src/strass/ @@ -296,7 +310,8 @@ black: # credits https://rpadovani.com/gitlab-code-coverage .checkCoverage: - needs: ["build"] + needs: ["🳠build"] + stage: "🩺 test" image: alpine:latest variables: JOB_NAME: build @@ -312,28 +327,25 @@ black: - if [ "$CURRENT_COVERAGE" -lt "$TARGET_COVERAGE" ]; then echo "Coverage decreased from ${TARGET_COVERAGE} to ${CURRENT_COVERAGE}" && exit 1; fi; - -checkCoverageMasterOrProd: +"💯 checkCoverageMasterOrProd": extends: .checkCoverage only: variables: - $CI_COMMIT_REF_SLUG =~ /-prod$/ - $CI_COMMIT_REF_SLUG == "master" - stage: test -checkCoverageOther: +"💯 checkCoverageOther": extends: .checkCoverage except: variables: - $CI_COMMIT_REF_SLUG =~ /-prod$/ - $CI_COMMIT_REF_SLUG == "master" - stage: deploy -test-migrations-and-lang-ar-up-to-date: - stage: test +"🩺 test-migrations-and-lang-ar-up-to-date": + stage: "🩺 test" needs: [] image: python:3.11 variables: @@ -354,9 +366,9 @@ test-migrations-and-lang-ar-up-to-date: ssi-test: - needs: ["build"] + needs: ["🳠build"] when: manual - stage: test + stage: "🩺 test" before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY cache: diff --git a/doc/_static/merge-request-pipelines-all-cut-dev.png b/doc/_static/merge-request-pipelines-all-cut-dev.png new file mode 100644 index 0000000000000000000000000000000000000000..92c98b25e2b1fd0c6bed2eb3d526afc0b598fc3a Binary files /dev/null and b/doc/_static/merge-request-pipelines-all-cut-dev.png differ diff --git a/doc/_static/merge-request-pipelines-all-cut.png b/doc/_static/merge-request-pipelines-all-cut.png deleted file mode 100644 index a298ec2f9d99d9c529ecc6b13b31bf42253dbffe..0000000000000000000000000000000000000000 Binary files a/doc/_static/merge-request-pipelines-all-cut.png and /dev/null differ diff --git a/doc/_static/merge-request-pipelines-all.png b/doc/_static/merge-request-pipelines-all.png deleted file mode 100644 index 38e84e27ab77476ad0a04f97faba5948fe9dc797..0000000000000000000000000000000000000000 Binary files a/doc/_static/merge-request-pipelines-all.png and /dev/null differ diff --git a/doc/_static/merge-request-pipelines-delete-dev.png b/doc/_static/merge-request-pipelines-delete-dev.png index eda7aa35d1e60097dd30e8d0a3e87779624eb792..cccf3ec0ed458305b3e5fce813de2bb22d9e6e40 100644 Binary files a/doc/_static/merge-request-pipelines-delete-dev.png and b/doc/_static/merge-request-pipelines-delete-dev.png differ diff --git a/doc/_static/merge-request-pipelines-delete.png b/doc/_static/merge-request-pipelines-delete.png index 70b73e781138b84fb31bb35dc748c5537c5aa273..f19deb188386f5c16d07f8782ecb098498bc1b9d 100644 Binary files a/doc/_static/merge-request-pipelines-delete.png and b/doc/_static/merge-request-pipelines-delete.png differ diff --git a/doc/_static/merge-request-pipelines.png b/doc/_static/merge-request-pipelines.png index 448eb544c92b5a8eaad3dd3e74ea3db1521ee564..6044d0dbee3cb61b7e6b7c53e03af9063b2ab3fe 100644 Binary files a/doc/_static/merge-request-pipelines.png and b/doc/_static/merge-request-pipelines.png differ diff --git a/doc/life_cycle.rst b/doc/life_cycle.rst index ec82c500d6f404fae2f961de5d67e5de3e8929ac..161f5970b864933c185ecc44bc540892699d03fb 100644 --- a/doc/life_cycle.rst +++ b/doc/life_cycle.rst @@ -78,8 +78,9 @@ all pipelines are now green. :alt: Pipelines all in green -On the right part, the third green checkmark (named A) allows you to see all job related to -the deployment of the instance. You see the `deploy_prod` went well. To open the public access just click on the play +On the right part, the fourth circle (named A) allows you to see all job related to +the deployment of the instance. +To open the public access just click on the play button next to `open_public_access` (named B) and wait for the job completion. Similarly, to close the public access juste click on the play button next to `close_public_access` (named C) and wait for the job completion. diff --git a/doc/life_cycle_demo.rst b/doc/life_cycle_demo.rst index b84c5c68916f600bd54c31ed50a2948293b0eec2..7c4c529d955fac79fe008f4ecbe19ddd2a6bb729 100644 --- a/doc/life_cycle_demo.rst +++ b/doc/life_cycle_demo.rst @@ -48,14 +48,16 @@ Load the demo ? ------------------------------------------------------------------------------- You can load the demo, but you need kubectl installed, and you need to be granted on the dev namespace. -If you understand this requirementsadd, then see :ref:`load_demo_k8s` on know how to load the demo in kubernetes +If you understand this requirements, then see :ref:`load_demo_k8s` on know how to load the demo in kubernetes Stop it ------------------------------------------------------------------------------- +It is automatically done when you merge your branch, but If you just close it you need to stop it first. + In the pipelines (A), see the job "stop_and_delete_instance" (D) -.. image:: _static/merge-request-pipelines-all-cut.png +.. image:: _static/merge-request-pipelines-all-cut-dev.png :width: 100% :alt: Pipelines all in green