diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee342381c5bf2c97c2e2b1f7a124b22320e4f88c..91f90e9b2e1e3e7206ba15d295602f99b94db86b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,29 +1,35 @@ +# variables in the GitLab CI/CD variables: + # GITLAB_TOKEN to support the semantic-release + # DOCKER_AUTH_CONFIG to support the usage of private docker images as job docker image + # TMPL_RELEASE_ENABLED to enable the semantic-release job + # TBC_NAMESPACE: smartdatalab/public/ci-cd-components + include: - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/gitlab-ci/extract@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitlab-ci/extract@master inputs: extract-script-job-tags: ["docker"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/gitlab-ci/validation@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitlab-ci/validation@master inputs: check-links-job-tags: ["docker"] tbc-check-job-tags: ["docker"] tbc-check-image: cicd-docker-dev.artifact.tecnalia.com/tbc-check:master gitlab-ci-lint-job-tags: ["docker"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/kicker/validation@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/kicker/validation@master inputs: kicker-validation-job-tags: ["docker"] schema-base-url: "https://git.code.tecnalia.com/api/v4/projects/smartdatalab%2Fpublic%2Fci-cd-components%2Fkicker/repository/files" - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/bash/gitlab-ci-bash@master + yajsv-image: "cicd-docker-dev.artifact.tecnalia.com/yajsv:latest" + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/bash/gitlab-ci-bash@master inputs: bash-shellcheck-job-tags: ["docker"] + shellcheck-files: "*.sh" + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitleaks/gitlab-ci-gitleaks@master + inputs: + gitleaks-job-tags: ["docker"] - local: "templates/gitlab-ci-semrel.yml" -stages: - - build - - publish - variables: GITLAB_CI_FILES: "templates/gitlab-ci-semrel.yml" - BASH_SHELLCHECK_FILES: "*.sh" GIT_STRATEGY: clone semantic-release: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9760aaddd7085f5802d23c7219be45841c69b9c4..959e468a7a500a1df50b695127fba7f51029d221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ -# [3.11.0](https://git.code.tecnalia.com/smartdatalab/public/ci-cd-components/semantic-release/compare/3.10.3...3.11.0) (2024-07-02) +## [3.11.1](https://gitlab.com/to-be-continuous/semantic-release/compare/3.11.0...3.11.1) (2024-07-09) -### Features +### Bug Fixes -* add support for configuring a commit specification (e.g. "conventional commits") ([c4519fd](https://git.code.tecnalia.com/smartdatalab/public/ci-cd-components/semantic-release/commit/c4519fdb1100437dced3ba2bf93c8c069545f303)) +* generated (YAML) configuration syntax error when using JSON input config ([73865b9](https://gitlab.com/to-be-continuous/semantic-release/commit/73865b9e3bdd581eaf52f368cfd917fbe16473e4)) # [3.11.0](https://gitlab.com/to-be-continuous/semantic-release/compare/3.10.3...3.11.0) (2024-06-02) diff --git a/README.md b/README.md index bc3a39f1f35eeb1017283c0f3be6edb907c4a10b..62c8779ec5109beaf34797b8a59e508d00b9c7e1 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,16 @@ This project implements a GitLab CI/CD template to automate your versioning and ## Usage -This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component-in-a-cicd-configuration) or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax. +This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component) or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax. ### Use as a CI/CD component -Add the following to your `gitlab-ci.yml`: +Add the following to your `.gitlab-ci.yml`: ```yaml include: # 1: include the component - - component: gitlab.com/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.0 + - component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.2 # 2: set/override component inputs inputs: changelog-enabled: true # ⚠ this is only an example @@ -28,13 +28,13 @@ include: ### Use as a CI/CD template (legacy) -Add the following to your `gitlab-ci.yml`: +Add the following to your `.gitlab-ci.yml`: ```yaml include: # 1: include the template - project: 'to-be-continuous/semantic-release' - ref: '3.11.0' + ref: '3.11.2' file: '/templates/gitlab-ci-semrel.yml' variables: @@ -213,7 +213,7 @@ If the version of Semantic Release is pinned using [`SEMREL_VERSION`](#global-co Here are some advices about your **secrets** (variables marked with a :lock:): -1. Manage them as [project or group CI/CD variables](https://docs.gitlab.com/ee/ci/variables/#add-a-cicd-variable-to-a-project): +1. Manage them as [project or group CI/CD variables](https://docs.gitlab.com/ee/ci/variables/#for-a-project): * [**masked**](https://docs.gitlab.com/ee/ci/variables/#mask-a-cicd-variable) to prevent them from being inadvertently displayed in your job logs, * [**protected**](https://docs.gitlab.com/ee/ci/variables/#protected-cicd-variables) if you want to secure some secrets @@ -380,9 +380,9 @@ With: ```yaml include: # main template - - component: gitlab.com/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.0 + - component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.2 # Vault variant - - component: gitlab.com/to-be-continuous/semantic-release/gitlab-ci-semrel-vault@3.11.0 + - component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel-vault@3.11.2 inputs: vault-base-url: "https://vault.acme.host/v1" # audience claim for JWT diff --git a/templates/gitlab-ci-semrel-vault.yml b/templates/gitlab-ci-semrel-vault.yml index eb68b1a5855a43e72768db09b78c46cd3e8b6c68..1f748760fd9b14e10860865dae41c8354810356b 100644 --- a/templates/gitlab-ci-semrel-vault.yml +++ b/templates/gitlab-ci-semrel-vault.yml @@ -22,7 +22,7 @@ variables: .semrel-base: services: - name: "$TBC_TRACKING_IMAGE" - command: ["--service", "semrel", "3.11.0"] + command: ["--service", "semrel", "3.11.2"] - name: "$TBC_VAULT_IMAGE" alias: "vault-secrets-provider" variables: diff --git a/templates/gitlab-ci-semrel.yml b/templates/gitlab-ci-semrel.yml index 13a2a920654e2dbc03a55a07e4d5243e2b582530..75575e74250b8f4c2a9654638c3ecbe572d8ce31 100644 --- a/templates/gitlab-ci-semrel.yml +++ b/templates/gitlab-ci-semrel.yml @@ -556,8 +556,10 @@ stages: fi if [[ -n "$TRACE" ]]; then - log_info "Installed devDependencies..." - npm pkg get devDependencies + if [[ -f "./package.json" ]]; then + log_info "Installed devDependencies..." + npm pkg get devDependencies + fi log_info "Globally installed packages..." npm list --global fi @@ -691,7 +693,7 @@ stages: releaserc_file="${semrelConfigFile}" rm -f "package.json" - yq eval -P 'with_entries(select((.key | . != "plugins") and (.key | . != "verifyConditions")))' "${releaserc_file}" > "${releaserc_file}.new" + yq eval -oyaml -P 'with_entries(select((.key | . != "plugins") and (.key | . != "verifyConditions")))' "${releaserc_file}" > "${releaserc_file}.new" # Generating the hook scripts that will generate the dotenv file # The dotenv file is generated in $TMPDIR so it will survive the git reset @@ -802,7 +804,7 @@ stages: image: $SEMREL_IMAGE services: - name: "$TBC_TRACKING_IMAGE" - command: ["--service", "semrel", "3.11.0"] + command: ["--service", "semrel", "3.11.2"] before_script: - !reference [.semrel-scripts] - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"