Table of Contents
Fetches and creates versioned GitLab releases.
Note that check
will skip tags that do not have associated releases.
⚠️ Limitations⚠️ GitLab has a known bug (28978, 375489) making impossible to download assets published to a project using a private-token. When using
in
with such release, download assets will contain the plain HTML of GitLab's sign-in page.Once fixed, this Concourse resource will behave as expected with no further modification.
repository
: Required. The repository name that contains the releases.access_token
: Required. Used for accessing a release in a private-repo during anin
and pushing a release to a repo during anout
. The access token you create is only required to have therepo
orpublic_repo
scope.gitlab_api_url
: Optional. If you use a non-public GitLab deployment then you can set your API URL here.insecure
: Optional. Defaultfalse
. When set totrue
, Concourse will allow insecure connection to your GitLab API.tag_filter
: Optional. If set, override default tag filter regular expression ofv?([^v].*)
. If the filter includes a capture group, the capture group is used as the release version; otherwise, the entire matching substring is used as the version.
- name: gl-release
type: gitlab-release
source:
repository: group/project
access_token: abcdef1234567890
- get: gl-release
- put: gl-release
params:
tag: path/to/tag/file
body: path/to/body/file
globs:
- paths/to/files/to/upload-*.tgz
To get a specific version of a release:
- get: gl-release
version: { tag: 'v0.0.1' }
To set a custom tag filter:
- name: gl-release
type: gitlab-release
source:
owner: concourse
repository: concourse
tag_filter: "version-(.*)"
Releases are listed and sorted by their tag, using https://github.com/cppforlife/go-semi-semantic. Few example:
v1.0.0
<v1.0.5
<v1.10.0
<v2.0.0
(intuitive behaviour)v1.0.0-dev1
<v1.0.0-dev2
<v1.0.0
(empty dash postfix takes priority)v1.0.0-dev10
<v1.0.0-rc1
(dash postfixes are compared alphabetically)v1.0.0.1
<v1.0.0_dev
(non integer parts are compared alphabetically,1
<0_dev
)
If version
is specified, check
returns releases from the specified version on.
Otherwise, check
returns the latest release.
Fetches artifacts from the given release version. If the version is not specified, the latest version is chosen using semver semantics.
Also creates the following files:
tag
containing the git tag name of the release being fetched.version
containing the version determined by the git tag of the release being fetched.body
containing the body text of the release.commit_sha
containing the commit SHA the tag is pointing to.
globs
: Optional. A list of globs for files that will be downloaded from the release. If not specified, all assets will be fetched.include_sources
: Optional. A list of source format to download from the release. If not specified, no sources will be fetched (i.e.:["zip", "tar.gz","tar.bz2", "tar"]
).include_source_tarball
: Optional. Enables downloading of the source artifact tarball for the release assource.tar.gz
. Defaults tofalse
. Equivalent toinclude_sources: ["tar.gz"]
.include_source_zip
: Optional. Enables downloading of the source artifact tarball for the release assource.zip
. Defaults tofalse
. Equivalent toinclude_sources: ["zip"]
.
Given a commit_sha
and tag
, this tags the commit and creates a release on GitLab,
then uploads the files matching the patterns in globs
to the release.
commitish
: Optional, if tag is not specified. A path to a file containing the commitish (SHA, tag, branch name) that the new tag and release should be associated with.tag
: Required. A path to a file containing the name of the Git tag to use for the release.tag_prefix
: Optional. If specified, the tag read from the file will be prepended with this string. This is useful for addingv
in front of version numbers.name
: Optional. A path to a file containing the name of the release. Defaults totag
value.body
: Optional. A path to a file containing the body text of the release.globs
: Optional. A list of globs for files that will be uploaded alongside the created release.
- Go lang is required - version 1.16 is tested; earlier versions may also work.
- Docker is required - version 19.03.x is tested; earlier versions may also work.
go mod
is used for dependency management of the golang packages.
The tests have been embedded with the Dockerfile
, ensuring that the testing
environment is consistent across any docker
enabled platform.
When the Docker image builds, the tests are run inside the Docker container,
on failure they will stop the building process.
Run the tests with the following command:
docker build -t gitlab-release-resource .
Please make all pull requests to the master
branch and ensure tests pass locally.
This project was initially created by @edtan and forked from gitlab-release-resource which is no longer maintained. It has been re-imported to get rid of the fork relationship to the repository github-release-resource.