diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-02 12:09:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-02 12:09:38 +0300 |
commit | aa84824d04b32ce9cd3abeac90a6bf78fb2be34c (patch) | |
tree | 379dffa10441e382014909ed8a694f1c0c4ec927 /doc/ci/components | |
parent | 96100bc70c151404efe5d261813131aaf72b0d41 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/components')
-rw-r--r-- | doc/ci/components/index.md | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/doc/ci/components/index.md b/doc/ci/components/index.md index 8246e1c4073..9063b6d0378 100644 --- a/doc/ci/components/index.md +++ b/doc/ci/components/index.md @@ -169,19 +169,34 @@ Nesting of components is not possible. For example: ## Release a component -To create a release for a CI/CD component, use either: +To create a release for a CI/CD component, use the [`release`](../yaml/index.md#release) +keyword in a CI/CD pipeline. -- The [`release`](../yaml/index.md#release) keyword in a CI/CD pipeline. Like in the - [component testing example](#test-the-component), you can set a component to automatically - be released after all tests pass in pipelines for new tags. -- The [UI for creating a release](../../user/project/releases/index.md#create-a-release). +For example: + +```yaml +create-release: + stage: deploy + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: $CI_COMMIT_TAG =~ /^v\d+/ + script: echo "Creating release $CI_COMMIT_TAG" + release: + tag_name: $CI_COMMIT_TAG + description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH" +``` + +In this example, the job runs only for tags formatted as `v` + version number. +If all previous jobs succeed, the release is created. + +Like in the [component testing example](#test-the-component), you can set a component to automatically +be released after all tests pass in pipelines for new tags. -All released versions of the components are displayed in the [CI/CD Catalog](catalog.md) -page for the given resource, providing users with information about official releases. +All released versions of the components repositories are displayed in the [CI/CD Catalog](catalog.md), +providing users with information about official releases. Components [can be used](#use-a-component-in-a-cicd-configuration) without being released, -but only with a commit SHA or a branch name. To enable the use of tags or the `~latest` version keyword, -you must create a release. +by using the commit SHA or ref. However, the `~latest` version keyword can only be used with released tags. ## Use a component in a CI/CD configuration |