1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/task/create-gitlab-release/0.1
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00
..
samples Modifies directory names based on the proposal 2020-07-14 19:01:58 +01:00
create-gitlab-release.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Create Gitlab Release

It is typical to create a Gitlab tag at the moment of release to introduce a checkpoint in your source code history, but in most cases users will need compiled objects or other assets output, not just the raw source code.

Gitlab Releases are a way to track deliverables in your project. Consider them a snapshot in time of the source, build output, artifacts, and other metadata associated with a released version of your code.

This task can be used to make the gitlab release.

Task can also be used to upload assets including binaries of the released version, with the release.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/create-gitlab-release/0.1/raw

Parameters

  • TAG_NAME: A git tag name that will be created with this release(e.g:v1.0.0).
  • NAME: The Name of the release (e.g:First release).
  • DESCRIPTION: A short description of the release (default:"").
  • RELEASE_REF: It can be a commit SHA, another tag name, or a branch name (default:master).
  • PROJECT_ID: The Gitlab id of the project, can be found on the repository page of the gitlab (e.g:18587362)
  • UPLOAD_ASSET_NAME: The name of the asset that needs to be uploaded (default:"").
  • UPLOAD_ASSET_URL: The uplaod URL for the hosted asset (default:"").
  • GITLAB_TOKEN_SECRET: The name of the secret holding the gitlab-token (default:gitlab-token).
  • GITLAB_TOKEN_SECRET_KEY: The name of the secret key holding the gitlab-token (default:GITLAB_TOKEN).

Secrets

  • Secret to provide personal access token of the Gitlab.

Check this to get personal access token for Gitlab.

Platforms

The Task can be run on linux/amd64 platform.

Usage

This task expects a secret named gitlab-token to exists, with a Gitlab personal access token in GITLAB_TOKEN with enough privileges to create a release.

At present, Gitlab doesn't provide the functionality to upload any file to the release directly, however file that is hosted on any platform (i.e aws s3 or gitlab) can be uploaded with the release by providing the hosted file URL path as the param to the task.

To make a release put all the required params in the Taskrun, add required secrets and release will be done.

Secrets can be created as follows:

apiVersion: v1
kind: Secret
metadata:
  name: gitlab-token
type: Opaque
stringData:
  GITLAB_TOKEN: $(personal-gitlab-token)

This samples can be referred to create Taskrun for Gitlab release.