ccd1080419
Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com> |
||
---|---|---|
.. | ||
samples | ||
create-gitlab-release.yaml | ||
README.md |
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://raw.githubusercontent.com/tektoncd/catalog/master/task/create-gitlab-release/0.1/create-gitlab-release.yaml
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 personalaccess token
of the Gitlab.
Check this to get personal access token for Gitlab
.
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.