Skip to content
Commits on Source (26)
# 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:
- project: "to-be-continuous/tools/gitlab-ci"
ref: "master"
file: "/templates/extract.yml"
- project: "to-be-continuous/tools/gitlab-ci"
ref: "master"
file: "/templates/validation.yml"
- project: "to-be-continuous/kicker"
ref: "master"
file: "/templates/validation.yml"
- component: $CI_SERVER_FQDN/to-be-continuous/bash/gitlab-ci-bash@3.5
- component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitlab-ci/extract@master
inputs:
extract-script-job-tags: ["docker"]
- 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.dev/tbc-check:master
gitlab-ci-lint-job-tags: ["docker"]
- component: $CI_SERVER_FQDN/$TBC_NAMESPACE/kicker/validation@master
inputs:
kicker-validation-job-tags: ["docker"]
schema-base-url: "https://git.code.tecnalia.dev/api/v4/projects/smartdatalab%2Fpublic%2Fci-cd-components%2Fkicker/repository/files"
- 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"
variables:
GITLAB_CI_FILES: "templates/gitlab-ci-semrel.yml"
GIT_STRATEGY: clone
semantic-release:
rules:
# on production branch(es): auto if SEMREL_AUTO_RELEASE_ENABLED
- if: '$TMPL_RELEASE_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
tags: ["docker"]
......@@ -15,7 +15,7 @@
## Logs and/or screenshots
(Join any relevant logs and/or screenshot. Please use code blocks (```) to format console output, logs, and code.)
(Join any relevant logs and/or screenshot. Please use code blocks (`` ``` ``) to format console output, logs, and code.)
## Context & Configuration
......
## [3.11.5](https://git.code.tecnalia.dev/smartdatalab/public/ci-cd-components/semantic-release/compare/3.11.4...3.11.5) (2025-01-20)
### Bug Fixes
* add preset to semantic-release-info ([6c074f6](https://git.code.tecnalia.dev/smartdatalab/public/ci-cd-components/semantic-release/commit/6c074f671b3e48480f8aea04f71df00f93d54fc0))
## [3.11.5](https://gitlab.com/to-be-continuous/semantic-release/compare/3.11.4...3.11.5) (2024-11-17)
### Bug Fixes
* add preset to semantic-release-info ([6c074f6](https://gitlab.com/to-be-continuous/semantic-release/commit/6c074f671b3e48480f8aea04f71df00f93d54fc0))
## [3.11.4](https://gitlab.com/to-be-continuous/semantic-release/compare/3.11.3...3.11.4) (2024-11-08)
......@@ -17,7 +31,7 @@
### Bug Fixes
* trace without package.json ([3d7b6b0](https://gitlab.com/to-be-continuous/semantic-release/commit/3d7b6b01637b8fc9c2ba5aa3a295460f07c84fc8))
* trace without package.json ([3d7b6b0](https://git.code.tecnalia.dev/smartdatalab/public/ci-cd-components/semantic-release/commit/3d7b6b01637b8fc9c2ba5aa3a295460f07c84fc8))
## [3.11.1](https://gitlab.com/to-be-continuous/semantic-release/compare/3.11.0...3.11.1) (2024-07-09)
......
......@@ -20,7 +20,7 @@ Add the following to your `.gitlab-ci.yml`:
```yaml
include:
# 1: include the component
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.4
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.5
# 2: set/override component inputs
inputs:
changelog-enabled: true # ⚠ this is only an example
......@@ -34,7 +34,7 @@ Add the following to your `.gitlab-ci.yml`:
include:
# 1: include the template
- project: 'to-be-continuous/semantic-release'
ref: '3.11.4'
ref: '3.11.5'
file: '/templates/gitlab-ci-semrel.yml'
variables:
......@@ -92,11 +92,12 @@ As specified in the previous chapter, these variables are only used to generated
| `changelog-title` / `SEMREL_CHANGELOG_TITLE` | [changelogTitle @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). You might want to use markdown format (for example `# MyApp Changelog`). | _none_ |
| `dry-run` / `SEMREL_DRY_RUN` | Activate the [dryRun semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun) if present. | _none_ |
| `auto-release-enabled` / `SEMREL_AUTO_RELEASE_ENABLED` | When set to `true` the job start automatically. When not set (default), the job is manual. | _none_ |
| `branches-ref` / `SEMREL_BRANCHES_REF` | Regular expression pattern matching branches from which releases should happen (should match your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches)) | `/^(master|main)$/` |
| `branches-ref` / `SEMREL_BRANCHES_REF` | Regular expression pattern matching branches from which releases should happen (should match your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches)) | `/^(master\|main)$/` |
| `tag-format` / `SEMREL_TAG_FORMAT` | [tagFormat semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat). :warning: don't forget to double the `$` character so it is not interpreted by GitLab. | `$${version}` |
| `hooks-dir` / `SEMREL_HOOKS_DIR` | [Hook scripts](#hook_scripts) folder. | `.` |
| `commit-message` / `SEMREL_COMMIT_MESSAGE` | Add a custom commit message based on [semantic-release/git option](https://github.com/semantic-release/git#message). | _none_ (uses semantic-release default commit message) |
| `release-disabled` / `SEMREL_RELEASE_DISABLED` | Disable this job. | _none_ |
| `semantic-release-job-tags` / `SEMANTIC_RELEASE_JOB_TAGS` | Tags to be used for selecting runners for the job | `[]` |
#### Hook scripts
......@@ -354,10 +355,12 @@ In order to be able to communicate with the Vault server, the variant requires t
| Input / Variable | Description | Default value |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `TBC_VAULT_IMAGE` | The [Vault Secrets Provider](https://gitlab.com/to-be-continuous/tools/vault-secrets-provider) image to use (can be overridden) | `registry.gitlab.com/to-be-continuous/tools/vault-secrets-provider:latest` |
| `vault-base-url` / `VAULT_BASE_URL` | The Vault server base API url | _none_ |
| `vault-base-url` / `VAULT_BASE_URL` | The Vault server base API url | **must be defined** |
| `vault-oidc-aud` / `VAULT_OIDC_AUD` | The `aud` claim for the JWT | `$CI_SERVER_URL` |
| :lock: `VAULT_ROLE_ID` | The [AppRole](https://www.vaultproject.io/docs/auth/approle) RoleID | **must be defined** |
| :lock: `VAULT_SECRET_ID` | The [AppRole](https://www.vaultproject.io/docs/auth/approle) SecretID | **must be defined** |
| :lock: `VAULT_ROLE_ID` | The [AppRole](https://www.vaultproject.io/docs/auth/approle) RoleID | _none_ |
| :lock: `VAULT_SECRET_ID` | The [AppRole](https://www.vaultproject.io/docs/auth/approle) SecretID | _none_ |
By default, the variant will authentifacte using a [JWT ID token](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html). To use [AppRole](https://www.vaultproject.io/docs/auth/approle) instead the `VAULT_ROLE_ID` and `VAULT_SECRET_ID` should be defined as secret project variables.
#### Usage
......@@ -379,9 +382,9 @@ With:
```yaml
include:
# main template
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.4
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel@3.11.5
# Vault variant
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel-vault@3.11.4
- component: $CI_SERVER_FQDN/to-be-continuous/semantic-release/gitlab-ci-semrel-vault@3.11.5
inputs:
vault-base-url: "https://vault.acme.host/v1"
# audience claim for JWT
......@@ -390,5 +393,4 @@ include:
variables:
# Secrets managed by Vault
GITLAB_TOKEN: "@url@http://vault-secrets-provider/api/secrets/b7ecb6ebabc231/semantic-release/token?field=group-access-token"
# $VAULT_ROLE_ID and $VAULT_SECRET_ID defined as a secret CI/CD variable
```
......@@ -27,7 +27,7 @@ if [[ "$curVer" ]]; then
log_info "Bump version from \\e[33;1m${curVer}\\e[0m to \\e[33;1m${nextVer}\\e[0m (release type: $relType)..."
# replace in README
sed -e "s/ref: *'$curVer'/ref: '$nextVer'/" -e "s/ref: *\"$curVer\/ref: \$nextVer\/" -e "s/component: *\(.*\)@$curVer/component: \1@$nextVer/" README.md > README.md.next
sed -e "s/ref: *'$curVer'/ref: '$nextVer'/" -e "s/ref: *\"$curVer\"/ref: \"$nextVer\"/" -e "s/component: *\(.*\)@$curVer/component: \1@$nextVer/" README.md > README.md.next
mv -f README.md.next README.md
# replace in template and variants
......
......@@ -106,6 +106,13 @@
"description": "[message @semantic-release/git option](https://github.com/semantic-release/git#message)",
"advanced": true
},
{
"name": "SEMANTIC_RELEASE_JOB_TAGS",
"description": "Tags to be used for selecting runners for the job",
"type": "array",
"default": [],
"advanced": true
},
{
"name": "SEMREL_COMMIT_SPEC",
"description": "Commit specification `preset` (possible values: `angular`, `atom`, `codemirror`, `ember`, `eslint`, `express`, `jquery`, `jshint`, `conventionalcommits`). The default is `angular`.",
......
......@@ -22,7 +22,7 @@ variables:
.semrel-base:
services:
- name: "$TBC_TRACKING_IMAGE"
command: ["--service", "semrel", "3.11.4"]
command: ["--service", "semrel", "3.11.5"]
- name: "$TBC_VAULT_IMAGE"
alias: "vault-secrets-provider"
variables:
......
......@@ -86,6 +86,11 @@ spec:
- protected
- all
default: ''
semantic-release-job-tags:
description: Tags to be used for selecting runners for the job
type: array
default: []
---
workflow:
rules:
......@@ -695,7 +700,7 @@ stages:
# Generating the hook scripts that will generate the dotenv file
# The dotenv file is generated in $TMPDIR so it will survive the git reset
dotenv_tmp="$(mktemp -t semrel-info-XXXXXXXXXX.dotenv)"
commitPresetConfig=$(generate_commit_preset_conf)
export_last_version_hook_script="./export-last-version.sh"
{
echo "#!/bin/bash"
......@@ -727,16 +732,13 @@ stages:
echo ""
echo "# injected (replace your plugins) plugins by the template to generate dotenv"
echo ""
echo "plugins: ["
echo " \"@semantic-release/commit-analyzer\","
echo " ["
echo " \"@semantic-release/exec\","
echo " {"
echo " \"analyzeCommitsCmd\": \"${export_last_version_hook_script} \\\"\${lastRelease.version}\\\"\"",
echo " \"verifyReleaseCmd\": \"${export_next_version_hook_script} \\\"\${nextRelease.version}\\\" \\\"\${nextRelease.type}\\\"\""
echo " }"
echo " ],"
echo "]"
echo "plugins:"
echo " - - '@semantic-release/commit-analyzer'"
echo "${commitPresetConfig}"
echo " - - '@semantic-release/exec'"
echo " - analyzeCommitsCmd: '\"${export_last_version_hook_script}\" \"\${lastRelease.version}\"'"
echo " verifyReleaseCmd: '\"${export_next_version_hook_script}\" \"\${nextRelease.version}\" \"\${nextRelease.type}\"'"
echo ""
} >> "${releaserc_file}.new"
mv -f "${releaserc_file}.new" ".releaserc"
......@@ -801,7 +803,7 @@ stages:
image: $SEMREL_IMAGE
services:
- name: "$TBC_TRACKING_IMAGE"
command: ["--service", "semrel", "3.11.4"]
command: ["--service", "semrel", "3.11.5"]
before_script:
- !reference [.semrel-scripts]
- install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
......@@ -864,3 +866,5 @@ semantic-release:
# else manual
- when: manual
allow_failure: true
tags: $[[ inputs.semantic-release-job-tags ]]