Support for release key in gitlab-ci.yaml
-
Review changes -
-
Download -
Patches
-
Plain diff
What does this MR do?
A new node is added to the gitlab-ci.yaml
file to support the creation of Releases. This MR will define the nodes added , validate them and make the parsed configuration available to the pipelines. The code to process the configuration will not be included in this MR.
The Release will only be created if the job is processed without error. If an error is returned
from Rails API during Release creation, the release
job will fail. There can multiple
release
jobs in a pipeline
release:
stage: release
only: tags
script:
- make changelog | tee release_changelog.txt
release:
name: Release $CI_TAG_NAME
tag_name: v0.06
description: ./release_changelog.txt
assets:
links:
- name: cool-app.zip
url: http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.zip
- name: cool-app.exe
url: http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.exe
These methods are supported:
-
tag_name
- mandatory -
name
- optional -
description
- mandatory -
assets
- optional -
assets:links:name
- optional -
assets:links:url
- mandatory ifassets
specified
release:tag_name
The tag_name
must be specified, and this can either refer to a Git tag or can be specified by the user.
If the $CI_COMMIT_TAG
predefined variable is specified
as a tag name, it is necessary to also specify only: [tags]
, otherwise the job will fail when
running against branches.
When the specified tag doesn't exist in repository, a new tag will be created from the associated
ref
of the pipeline. In this case, the tag will point to the latest commit of the ref
,
instead of the associated SHA of the pipeline.
For example, when creating a Release from a Git tag creation:
job:
release:
tag_name: $CI_COMMIT_TAG
description: changelog.txt
only:
- tags
It is also possible to create any unique tag, in which case only: tags
is not mandatory.
A semantic versioning example:
job:
release:
tag_name: ${MAJOR}_${MINOR}_${REVISION}
description: changelog.txt
- The Release will only be created if the main script of the job succeeded.
- If the Release already exists it will not update and will cause the job with
release
keyword to fail. - The
release
section executes after thescript
tag and before theafter_script
.
release:name
Specifies the Release name. This is an optional field, if omitted it will be populated with
release:tag_name
.
release:description
Specifies a file containing the longer description of the Release. This is a mandatory field and can point to a changelog.
release:assets
An array of release:assets:links
.
It is possible to add assets to a release, in the form of URLs pointing to an arbitrary external
location (such as a S3 bucket or package registry). Any external locations must be populated by
a code specified in the script
section.
job:
script:
- cd src
- go build hello-world.go
- make changelog | tee release_changelog.txt
release:
name: Release $CI_TAG_NAME
tag_name: v0.06
description: release_changelog.txt
assets:
- name: hello-world
url: https://s3.amazonaws.com/myapp_binaries/hello-world
The GitLab Runner will call the GitLab Rails API and create the Release object, adding assets as URLs if defined.
release:assets:links
An array of link
entries, optional.
release:
assets:
links:
- name: cool-app.zip
url: https://downloads.example.org/1.0-$CI_COMMIT_SHORT_SHA.zip
release:assets:links:url
Specifies any valid URL, mandatory if release:assets:links
are specified.
release:
assets:
links:
- url: https://downloads.example.org/cool-app.exe
release:assets:links:name
Optional entry. If this is provided, the release:assets:links:url
in the same links
array
element will be displayed using this name, instead of the raw URL.
release:
assets:
links:
- name: cool-app.zip
url: https://downloads.example.org/1.0-$CI_COMMIT_SHORT_SHA.zip
Tag Only jobs
This functionality has been moved to #118646 (closed)
Feature Flag
This feature will be controlled via a Feature Flag. Refer !19298 (comment 259989805)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Part of #26013 (closed)
Merge request reports
- version 70dda14c8b
- version 6924bebecc
- version 680b03005e
- version 6714c4f9ea
- version 66039e23e8
- version 6527cbf6dd
- version 64ffdf2421
- version 63d97d6d37
- version 622a95a1e7
- version 612f8e4e31
- version 60d2bfa168
- version 5992fc6934
- version 589a77c3e5
- version 5768d8bd78
- version 568e49e22a
- version 5572edb77d
- version 54b4c45fc5
- version 53344a819c
- version 52d15ab59c
- version 51af533464
- version 50bcd53aa7
- version 49771430f1
- version 48e9772324
- version 474039970b
- version 4690f79f57
- version 45bc191bbf
- version 44753a3d87
- version 43753a3d87
- version 42845e0413
- version 419224b568
- version 4055da6502
- version 39b4c3835c
- version 38a661763e
- version 3765ea90ca
- version 361d89244e
- version 354f6f392e
- version 34cc528118
- version 33d024491a
- version 32a45180c6
- version 31e6986a3e
- version 3096bbaaa9
- version 293d73f7fb
- version 283d73f7fb
- version 27cc9eb4c3
- version 267122ec7a
- version 25bbdce289
- version 24dcd771fc
- version 2318e2e689
- version 22b320eec1
- version 2139a76f2a
- version 2078369787
- version 19048047f4
- version 187b06e474
- version 174d075d5a
- version 161a033efb
- version 1546921809
- version 14019a7b92
- version 1384bf790b
- version 12c08d09c6
- version 1164b40a7b
- version 10c945b68e
- version 9b1c59521
- version 839058b50
- version 7ec85a422
- version 6d0c070d1
- version 5d421156c
- version 43ed5a072
- version 3b3e1fda2
- version 2f0ece377
- version 1e2ab4a04
- master (base)
- latest versionb249b7511 commit,
- version 70dda14c8b3 commits,
- version 6924bebecc2 commits,
- version 680b03005e2 commits,
- version 6714c4f9ea1 commit,
- version 66039e23e81 commit,
- version 6527cbf6dd2 commits,
- version 64ffdf24211 commit,
- version 63d97d6d371 commit,
- version 622a95a1e71 commit,
- version 612f8e4e311 commit,
- version 60d2bfa1681 commit,
- version 5992fc69341 commit,
- version 589a77c3e51 commit,
- version 5768d8bd781 commit,
- version 568e49e22a1 commit,
- version 5572edb77d9 commits,
- version 54b4c45fc59 commits,
- version 53344a819c8 commits,
- version 52d15ab59c7 commits,
- version 51af5334646 commits,
- version 50bcd53aa75 commits,
- version 49771430f14 commits,
- version 48e97723243 commits,
- version 474039970b2 commits,
- version 4690f79f572 commits,
- version 45bc191bbf1 commit,
- version 44753a3d877 commits,
- version 43753a3d877 commits,
- version 42845e041311 commits,
- version 419224b56811 commits,
- version 4055da650210 commits,
- version 39b4c3835c9 commits,
- version 38a661763e9 commits,
- version 3765ea90ca8 commits,
- version 361d89244e7 commits,
- version 354f6f392e6 commits,
- version 34cc5281186 commits,
- version 33d024491a6 commits,
- version 32a45180c65 commits,
- version 31e6986a3e3 commits,
- version 3096bbaaa92 commits,
- version 293d73f7fb1 commit,
- version 283d73f7fb1 commit,
- version 27cc9eb4c31 commit,
- version 267122ec7a1 commit,
- version 25bbdce2891 commit,
- version 24dcd771fc1 commit,
- version 2318e2e6891 commit,
- version 22b320eec11 commit,
- version 2139a76f2a1 commit,
- version 20783697871 commit,
- version 19048047f41 commit,
- version 187b06e4741 commit,
- version 174d075d5a1 commit,
- version 161a033efb3 commits,
- version 15469218092 commits,
- version 14019a7b922 commits,
- version 1384bf790b1 commit,
- version 12c08d09c61 commit,
- version 1164b40a7b2 commits,
- version 10c945b68e1 commit,
- version 9b1c595211 commit,
- version 839058b501 commit,
- version 7ec85a4221 commit,
- version 6d0c070d11 commit,
- version 5d421156c2 commits,
- version 43ed5a0721 commit,
- version 3b3e1fda21 commit,
- version 2f0ece3771 commit,
- version 1e2ab4a041 commit,
- Side-by-side
- Inline