From 0656629c67a811bd1eaacbbf1b0e150f77a65ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.me> Date: Tue, 5 Mar 2024 18:41:58 +0100 Subject: [PATCH] CI/CD => Remove auto changelog upload --- NodeApp/.gitlab-ci/00_vars.yml | 16 +-------- NodeApp/.gitlab-ci/04_stageCodeQuality.yml | 12 +++++-- NodeApp/.gitlab-ci/05_stageTest.yml | 10 +++++- NodeApp/.gitlab-ci/10_stageRelease.yml | 41 ---------------------- 4 files changed, 20 insertions(+), 59 deletions(-) diff --git a/NodeApp/.gitlab-ci/00_vars.yml b/NodeApp/.gitlab-ci/00_vars.yml index 65955c8..642e2de 100644 --- a/NodeApp/.gitlab-ci/00_vars.yml +++ b/NodeApp/.gitlab-ci/00_vars.yml @@ -34,18 +34,4 @@ variables: VERSION_DEV_SUFFIX: '-dev' VERSION_TEST_SUFFIX: '-test' - WIKI_FOLDER: Wiki - - DOC_CHANGELOG_FILE: ZolaApp/content/changelog/projects/101_cli.md - DOC_FILE_BEGIN: | - +++ - title = "Dojo CLI" - slug = "dojo-cli" - weight = 101 - template = "docs/page.html" - - [extra] - lead = "Changelog of The Dojo CLI." - toc = true - top = false - +++ + WIKI_FOLDER: Wiki \ No newline at end of file diff --git a/NodeApp/.gitlab-ci/04_stageCodeQuality.yml b/NodeApp/.gitlab-ci/04_stageCodeQuality.yml index c10eae8..4742d1e 100644 --- a/NodeApp/.gitlab-ci/04_stageCodeQuality.yml +++ b/NodeApp/.gitlab-ci/04_stageCodeQuality.yml @@ -9,7 +9,11 @@ code_quality:lint: - npm install - npm run lint rules: - - if: '$CI_COMMIT_TAG =~ "/^$/"' + - if: $CI_COMMIT_TAG + when: never + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: manual + - when: on_success code_quality:sonarqube: @@ -29,4 +33,8 @@ code_quality:sonarqube: script: - sonar-scanner rules: - - if: '$CI_COMMIT_TAG =~ "/^$/"' + - if: $CI_COMMIT_TAG + when: never + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: manual + - when: on_success diff --git a/NodeApp/.gitlab-ci/05_stageTest.yml b/NodeApp/.gitlab-ci/05_stageTest.yml index 914033e..9a70f95 100644 --- a/NodeApp/.gitlab-ci/05_stageTest.yml +++ b/NodeApp/.gitlab-ci/05_stageTest.yml @@ -12,4 +12,12 @@ test:build: # Build - !reference [ .build_cli, script ] rules: - - if: '$CI_COMMIT_TAG =~ "/^$/" && $CI_COMMIT_REF_PROTECTED != "true" && $CI_COMMIT_BRANCH != "test"' + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_REF_PROTECTED == "true" + when: never + - if: $CI_COMMIT_BRANCH == "test" + when: never + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: manual + - when: on_success diff --git a/NodeApp/.gitlab-ci/10_stageRelease.yml b/NodeApp/.gitlab-ci/10_stageRelease.yml index 0bb9f18..3485a45 100644 --- a/NodeApp/.gitlab-ci/10_stageRelease.yml +++ b/NodeApp/.gitlab-ci/10_stageRelease.yml @@ -47,47 +47,6 @@ release:doc:wiki: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' -release:doc:changelog: - stage: release - tags: - - release - image: ubuntu:latest - script: - # Install dependencies - - apt-get update -y - - apt-get install -y openssh-client git unzip sshpass --fix-missing - - # Add SSH key - - eval `ssh-agent -s` - - echo "$DOC_GIT_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - - echo "$DOC_GIT_SSH_PUBLIC_KEY" >> ~/.ssh/id_rsa.pub - - echo "$DOC_GIT_SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa - - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - - # Set git config - - git config --global user.email "dojo@minelli.me" - - git config --global user.name "[Gitlab CI/CD] ${PROJECT_NAME}" - - # Pull repo - - git clone ssh://git@ssh.hesge.ch:10572/dojo_project/projects/ui/dojodoc.git - - # Do something after pulling your repo - - echo "${DOC_FILE_BEGIN}$(cat CHANGELOG.md)" > dojodoc/${DOC_CHANGELOG_FILE} - - # Push repo changes into current repo - - cd dojodoc - - git add ${DOC_CHANGELOG_FILE} - - git commit -m "[Gitlab CI/CD] ${PROJECT_NAME} => Automatic update of changelog" || echo "No changes, nothing to commit!" - - git push - rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - - release:gitlab: stage: release tags: -- GitLab