Commit 0dca037a authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'selhorn-release-another' into 'master'

Updating more release content to match standards

See merge request gitlab-org/gitlab!73781
parents 73ad6282 4f012ed4
...@@ -3937,23 +3937,23 @@ you can ensure that concurrent deployments never happen to the production enviro ...@@ -3937,23 +3937,23 @@ you can ensure that concurrent deployments never happen to the production enviro
Use `release` to create a [release](../../user/project/releases/index.md). Use `release` to create a [release](../../user/project/releases/index.md).
The release job must have access to [`release-cli`](https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs) The release job must have access to the [`release-cli`](https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs)
when it runs. When using a runner with: and your runner must be using one of these executors:
- The [Docker executor](https://docs.gitlab.com/runner/executors/docker.html), use - If you use the [Docker executor](https://docs.gitlab.com/runner/executors/docker.html),
[`image:`](#image) and a Docker image that includes `release-cli`. For example, your [`image:`](#image) must include the `release-cli`. You can use this image from the GitLab
this image from the GitLab.com Container registry: `registry.gitlab.com/gitlab-org/release-cli:latest` Container Registry: `registry.gitlab.com/gitlab-org/release-cli:latest`
- The [Shell executor](https://docs.gitlab.com/runner/executors/shell.html), the server - If you use the [Shell executor](https://docs.gitlab.com/runner/executors/shell.html), the server
where the runner is registered must [have `release-cli` installed](../../user/project/releases/release_cli.md). where the runner is registered must have the `release-cli` [installed](../../user/project/releases/release_cli.md).
**Keyword type**: Job keyword. You can use it only as part of a job. **Keyword type**: Job keyword. You can use it only as part of a job.
**Possible inputs**: The `release:` subkeys: **Possible inputs**: The `release:` subkeys:
- [`tag_name`](#releasetag_name) - [`tag_name`](#releasetag_name)
- [`description`](#releasedescription)
- [`name`](#releasename) (optional) - [`name`](#releasename) (optional)
- [`description`](#releasedescription)
- [`ref`](#releaseref) (optional) - [`ref`](#releaseref) (optional)
- [`milestones`](#releasemilestones) (optional) - [`milestones`](#releasemilestones) (optional)
- [`released_at`](#releasereleased_at) (optional) - [`released_at`](#releasereleased_at) (optional)
...@@ -3981,16 +3981,19 @@ This example creates a release: ...@@ -3981,16 +3981,19 @@ This example creates a release:
**Additional details**: **Additional details**:
- All jobs except [trigger](#trigger) jobs must have the `script` keyword. A `release` - All release jobs, except [trigger](#trigger) jobs, must include the `script` keyword. A release
job can use the output from script commands, but you can use a placeholder script if job can use the output from script commands. If you don't need the script, you can use a placeholder:
the script is not needed:
```yaml ```yaml
script: script:
- echo 'release job' - echo 'release job'
``` ```
An [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/223856) exists to remove this requirement in an upcoming version of GitLab. An [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/223856) exists to remove this requirement.
- The `release` section executes after the `script` keyword and before the `after_script`.
- A release is created only if the job's main script succeeds.
- If the release already exists, it is not updated and the job with the `release` keyword fails.
**Related topics**: **Related topics**:
...@@ -4000,37 +4003,46 @@ This example creates a release: ...@@ -4000,37 +4003,46 @@ This example creates a release:
#### `release:tag_name` #### `release:tag_name`
You must specify a `tag_name` for the release. The tag can refer to an existing Git tag or Required. The Git tag for the release.
you can specify a new tag.
If the tag does not exist in the project yet, it is created at the same time as the release.
New tags use the SHA associated with the pipeline.
**Keyword type**: Job keyword. You can use it only as part of a job.
**Possible inputs**: A tag name. Can use [CI/CD variables](../variables/index.md).
When the specified tag doesn't exist in the repository, a new tag is created from the associated SHA of the pipeline. **Example of `release:tag_name`**:
For example, when creating a release from a Git tag: To create a release when a new tag is added to the project:
- Use the `$CI_COMMIT_TAG` CI/CD variable as the `tag_name`.
- Use [`rules:if`](#rulesif) or [`only: tags`](#onlyrefs--exceptrefs) to configure
the job to run only for new tags.
```yaml ```yaml
job: job:
script: echo 'Running the release job for the new tag.'
release: release:
tag_name: $CI_COMMIT_TAG tag_name: $CI_COMMIT_TAG
description: 'Release description' description: 'Release description'
rules:
- if: $CI_COMMIT_TAG
``` ```
It is also possible for the release job to automatically create a new unique tag. In that case, To create a release and a new tag at the same time, your [`rules`](#rules) or [`only`](#only--except)
do not use [`rules`](#rules) or [`only`](#only--except) to configure the job to should **not** configure the job to run only for new tags. A semantic versioning example:
only run for tags.
A semantic versioning example:
```yaml ```yaml
job: job:
script: echo 'Running the release job and creating a new tag.'
release: release:
tag_name: ${MAJOR}_${MINOR}_${REVISION} tag_name: ${MAJOR}_${MINOR}_${REVISION}
description: 'Release description' description: 'Release description'
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
``` ```
- The release is created only if the job's main script succeeds.
- If the release already exists, it is not updated and the job with the `release` keyword fails.
- The `release` section executes after the `script` tag and before the `after_script`.
#### `release:name` #### `release:name`
The release name. If omitted, it is populated with the value of `release: tag_name`. The release name. If omitted, it is populated with the value of `release: tag_name`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment