diff --git a/NodeApp/.gitlab-ci/00_vars.yml b/NodeApp/.gitlab-ci/00_vars.yml index 65955c8e7bef95f42e8ade31285b19ced34c2b93..642e2de4b7e2ad37e4cdb90bab91aa7676f34cf3 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/02_templates.yml b/NodeApp/.gitlab-ci/02_templates.yml index 41ca52ff2ee29ca7b5adc9f7483c279d35c21b81..828f2739126784378c409ab38d42a9473d7c78b0 100644 --- a/NodeApp/.gitlab-ci/02_templates.yml +++ b/NodeApp/.gitlab-ci/02_templates.yml @@ -56,7 +56,7 @@ - $ARTIFACTS_FOLDER/* expire_in: 10 mins rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' + - if: $CI_COMMIT_REF_PROTECTED == "true" .pkg_and_sign:macos: @@ -90,4 +90,4 @@ - $ARTIFACTS_FOLDER/* expire_in: 10 mins rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' \ No newline at end of file + - if: $CI_COMMIT_REF_PROTECTED == "true" \ No newline at end of file diff --git a/NodeApp/.gitlab-ci/04_stageCodeQuality.yml b/NodeApp/.gitlab-ci/04_stageCodeQuality.yml index c10eae8504baed8bbb2688b9be5e6aef396bdd20..4742d1e1751730bf864712b27bcbd20fbec4b407 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 914033e3daf27044c12958f49ffb58bd6a093e08..9a70f95723f890ff766498cb96557381c5fc94a8 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/06_stageBuild.yml b/NodeApp/.gitlab-ci/06_stageBuild.yml index f1aeaa2e13cd5e49b54436ee79fcf96cc86d0cc8..322912d428fd17654ce5f4833bc98399f72dfe86 100644 --- a/NodeApp/.gitlab-ci/06_stageBuild.yml +++ b/NodeApp/.gitlab-ci/06_stageBuild.yml @@ -20,4 +20,5 @@ build:version: - $ARTIFACTS_FOLDER/* expire_in: 10 mins rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true" || $CI_COMMIT_BRANCH == "test"' + - if: $CI_COMMIT_REF_PROTECTED == "true" + - if: $CI_COMMIT_BRANCH == "test" diff --git a/NodeApp/.gitlab-ci/07_stagePkgAndSign.yml b/NodeApp/.gitlab-ci/07_stagePkgAndSign.yml index 9bc92c1271d8a4c5bbb38da65297a0637eaaf192..be2b3baea3811d354c555a6d2166faff614c4483 100644 --- a/NodeApp/.gitlab-ci/07_stagePkgAndSign.yml +++ b/NodeApp/.gitlab-ci/07_stagePkgAndSign.yml @@ -19,7 +19,7 @@ pkg_and_sign:debian:test: artifacts: expire_in: 2 weeks rules: - - if: '$CI_COMMIT_BRANCH == "test"' + - if: $CI_COMMIT_BRANCH == "test" pkg_and_sign:macos: @@ -37,7 +37,7 @@ pkg_and_sign:macos:test: artifacts: expire_in: 2 weeks rules: - - if: '$CI_COMMIT_BRANCH == "test"' + - if: $CI_COMMIT_BRANCH == "test" diff --git a/NodeApp/.gitlab-ci/08_stageClean.yml b/NodeApp/.gitlab-ci/08_stageClean.yml index ef5ae4c248e0caf6c90cd69f6c7f089ec0347078..8954bd7224bd9bc358e147ab60393f53d509a590 100644 --- a/NodeApp/.gitlab-ci/08_stageClean.yml +++ b/NodeApp/.gitlab-ci/08_stageClean.yml @@ -8,7 +8,7 @@ clean:release: - !reference [ .get_version_dependent_vars, script ] - !reference [ .clean_release, script ] rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' + - if: $CI_COMMIT_REF_PROTECTED == "true" clean:packages: @@ -21,7 +21,7 @@ clean:packages: - !reference [ .get_version_dependent_vars, script ] - !reference [ .clean_packages, script ] rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' + - if: $CI_COMMIT_REF_PROTECTED == "true" clean:release:dev: @@ -35,7 +35,7 @@ clean:release:dev: - !reference [ .get_version_dependent_vars, script ] - !reference [ .clean_release, script ] rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH clean:packages:dev: @@ -49,7 +49,7 @@ clean:packages:dev: - !reference [ .get_version_dependent_vars, script ] - !reference [ .clean_packages, script ] rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH clean:release:latest: @@ -61,7 +61,7 @@ clean:release:latest: - VERSION="Latest" - !reference [ .clean_release, script ] rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH clean:release:pre-alpha: @@ -73,4 +73,6 @@ clean:release:pre-alpha: - VERSION="Pre-alpha" - !reference [ .clean_release, script ] rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' \ No newline at end of file + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: never + - if: $CI_COMMIT_REF_PROTECTED == "true" \ No newline at end of file diff --git a/NodeApp/.gitlab-ci/09_stageUpload.yml b/NodeApp/.gitlab-ci/09_stageUpload.yml index fac7c20fc3fff7648f4fe46b42a689d82e188149..7d50365f4dda4a6af7c36d127d2287ebbf0e76c9 100644 --- a/NodeApp/.gitlab-ci/09_stageUpload.yml +++ b/NodeApp/.gitlab-ci/09_stageUpload.yml @@ -27,7 +27,7 @@ upload:packages: - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${BIN_FILE_WINDOWS_ARM64} "${PACKAGE_URL_WINDOWS_ARM64_BIN}";' - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${BIN_FILE_WINDOWS_X64} "${PACKAGE_URL_WINDOWS_X64_BIN}";' rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' + - if: $CI_COMMIT_REF_PROTECTED == "true" upload:packages:doc:wiki: @@ -51,4 +51,4 @@ upload:packages:doc:wiki: # Send package - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${WIKI_ARCHIVE_PATH} "${PACKAGE_URL_WIKI}";' rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' \ No newline at end of file + - if: $CI_COMMIT_REF_PROTECTED == "true" \ No newline at end of file diff --git a/NodeApp/.gitlab-ci/10_stageRelease.yml b/NodeApp/.gitlab-ci/10_stageRelease.yml index 0bb9f18d7afd1d151fde0848d081c32998548511..e48306feedb7b625fc12e9a6f0a61d446d87d02f 100644 --- a/NodeApp/.gitlab-ci/10_stageRelease.yml +++ b/NodeApp/.gitlab-ci/10_stageRelease.yml @@ -44,48 +44,7 @@ release:doc:wiki: # Push the change back to the master branch of the wiki - git push origin "HEAD:main" rules: - - 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' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH release:gitlab: @@ -99,7 +58,7 @@ release:gitlab: - RELEASE_NAME=$VERSION - !reference [ .release_gitlab, script ] rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true"' + - if: $CI_COMMIT_REF_PROTECTED == "true" release:gitlab:latest: @@ -113,7 +72,7 @@ release:gitlab:latest: - RELEASE_NAME="Latest" - !reference [ .release_gitlab, script ] rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH release:gitlab:pre-alpha: @@ -127,4 +86,6 @@ release:gitlab:pre-alpha: - RELEASE_NAME="Pre-alpha" - !reference [ .release_gitlab, script ] rules: - - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH' \ No newline at end of file + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + when: never + - if: $CI_COMMIT_REF_PROTECTED == "true" \ No newline at end of file