gitlab-cli
GitLab CLI is a command-line tool that allows you to interact with the GitLab API.See https://gitlab.com/gitlab-org/cli for more information.
This module also contains the (deprecated) GitLab Release CLI.
See https://gitlab.com/gitlab-org/release-cli for more information.
Installation
dagger install github.com/vbehar/daggerverse/gitlab-cli@v0.9.0
Entrypoint
Return Type
GitlabCli !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
privateToken | Secret | - | private (personal) token to use for authentication with GitLab. |
jobToken | Secret | - | (CI) job token to use for authentication with GitLab. Defined as CI_JOB_TOKEN in the GitLab CI environment. |
host | String | - | host of the GitLab instance. |
repo | String | - | default gitlab repository for commands accepting the --repo flag. |
group | String | - | default gitlab group for commands accepting the --group flag. |
releaseCliVersion | String | "v0.18.0" | version of the GitLab Release CLI tool to use. https://gitlab.com/gitlab-org/release-cli |
Example
func (m *myModule) example() *GitlabCli {
return dag.
GitlabCli()
}
Types
GitlabCli π
GitlabCli is a Dagger Module to interact with the GitLab CLI.
privateToken() π
Return Type
Secret !
Example
func (m *myModule) example() *Secret {
return dag.
GitlabCli().
PrivateToken()
}
jobToken() π
Return Type
Secret !
Example
func (m *myModule) example() *Secret {
return dag.
GitlabCli().
JobToken()
}
host() π
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
GitlabCli().
Host(ctx)
}
repo() π
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
GitlabCli().
Repo(ctx)
}
group() π
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
GitlabCli().
Group(ctx)
}
releaseCliVersion() π
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
GitlabCli().
ReleaseCliVersion(ctx)
}
container() π
Container returns a container with the GitLab CLI installed.
Return Type
Container !
Example
func (m *myModule) example() *Container {
return dag.
GitlabCli().
Container()
}
run() π
Run runs the glab CLI with the given arguments.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] | - | arguments to pass to the glab CLI |
ctr | Container | - | container to use for the command, instead of the default container you can use this to customize the container |
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
GitlabCli().
Run(ctx)
}
release() π
Release allows you to interact with GitLab Releases.
Return Type
GitlabCliRelease !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tagName | String ! | - | name of the tag. |
descriptionFile | File | - | a file from which to read the release description. |
ctr | Container | - | container to use for the command, instead of the default container you can use this to customize the container |
Example
func (m *myModule) example(tagName string) *GitlabCliRelease {
return dag.
GitlabCli().
Release(tagName)
}
GitlabCliRelease π
Release allows you to interact with GitLab Releases.
tagName() π
Return Type
String !
Example
func (m *myModule) example(ctx context.Context, tagName string) string {
return dag.
GitlabCli().
Release(tagName).
TagName(ctx)
}
descriptionFile() π
Return Type
File !
Example
func (m *myModule) example(tagName string) *File {
return dag.
GitlabCli().
Release(tagName).
DescriptionFile()
}
ctr() π
Return Type
Container !
Example
func (m *myModule) example(tagName string) *Container {
return dag.
GitlabCli().
Release(tagName).
Ctr()
}
container() π
Container returns a container ready to be used for managing releases.
Return Type
Container !
Example
func (m *myModule) example(tagName string) *Container {
return dag.
GitlabCli().
Release(tagName).
Container()
}
create() π
CreateRelease creates a new release for the given tag. If the tag doesnβt exist, it will be created - if you also provide a gitRef.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
gitRef | String | - | if the tag should be created, it will be created from this ref. can be a commit or a branch. |
Example
func (m *myModule) example(ctx context.Context, tagName string) string {
return dag.
GitlabCli().
Release(tagName).
Create(ctx)
}
update() π
UpdateRelease updates an existing release for the given tag.
Return Type
String !
Example
func (m *myModule) example(ctx context.Context, tagName string) string {
return dag.
GitlabCli().
Release(tagName).
Update(ctx)
}