Dagger
Search

gitlab

No long description provided.

Installation

dagger install github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8

Entrypoint

Return Type
Gitlab
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
func (m *MyModule) Example() *dagger.Gitlab  {
	return dag.
			Gitlab()
}
@function
def example() -> dagger.Gitlab:
	return (
		dag.gitlab()
	)
@func()
example(): Gitlab {
	return dag
		.gitlab()
}

Types

Gitlab 🔗

cloneWithToken() 🔗

Clone clones a git repo using a container and returns the Directory

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
repoUrlString !-No description provided
tokenSecret !-No description provided
branchString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 clone-with-token --repo-url string --token env:MYSECRET --branch string
func (m *MyModule) Example(repoUrl string, token *dagger.Secret, branch string) *dagger.Directory  {
	return dag.
			Gitlab().
			CloneWithToken(repoUrl, token, branch)
}
@function
def example(repo_url: str, token: dagger.Secret, branch: str) -> dagger.Directory:
	return (
		dag.gitlab()
		.clone_with_token(repo_url, token, branch)
	)
@func()
example(repoUrl: string, token: Secret, branch: string): Directory {
	return dag
		.gitlab()
		.cloneWithToken(repoUrl, token, branch)
}

getMergeRequestId() 🔗

GetMergeRequestID finds the MR ID (IID) by title

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-No description provided
serverString !-No description provided
projectIdString !-No description provided
mergeRequestTitleString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 get-merge-request-id --token env:MYSECRET --server string --project-id string --merge-request-title string
func (m *MyModule) Example(ctx context.Context, token *dagger.Secret, server string, projectId string, mergeRequestTitle string) string  {
	return dag.
			Gitlab().
			GetMergeRequestId(ctx, token, server, projectId, mergeRequestTitle)
}
@function
async def example(token: dagger.Secret, server: str, project_id: str, merge_request_title: str) -> str:
	return await (
		dag.gitlab()
		.get_merge_request_id(token, server, project_id, merge_request_title)
	)
@func()
async example(token: Secret, server: string, projectId: string, mergeRequestTitle: string): Promise<string> {
	return dag
		.gitlab()
		.getMergeRequestId(token, server, projectId, mergeRequestTitle)
}

getProjectId() 🔗

GetProjectID looks up a project ID by its name and group path

Return Type
String !
Arguments
NameTypeDefault ValueDescription
serverString !-No description provided
tokenSecret !-No description provided
projectNameString !-e.g., "resource-engines"
groupPathString !-e.g., "Lab/stuttgart-things/idp"
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 get-project-id --server string --token env:MYSECRET --project-name string --group-path string
func (m *MyModule) Example(ctx context.Context, server string, token *dagger.Secret, projectName string, groupPath string) string  {
	return dag.
			Gitlab().
			GetProjectId(ctx, server, token, projectName, groupPath)
}
@function
async def example(server: str, token: dagger.Secret, project_name: str, group_path: str) -> str:
	return await (
		dag.gitlab()
		.get_project_id(server, token, project_name, group_path)
	)
@func()
async example(server: string, token: Secret, projectName: string, groupPath: string): Promise<string> {
	return dag
		.gitlab()
		.getProjectId(server, token, projectName, groupPath)
}

listGitlabPipelines() 🔗

ListGitlabPipelines lists CI/CD pipelines for a GitLab project using the glab CLI. Returns the pipeline list as JSON.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-GitLab project path in format "group/project" or "group/subgroup/project"
tokenSecret !-GitLab token for authentication
gitlabHostString "gitlab.com"GitLab host (e.g., "gitlab.com" or custom instance)
refString -Filter by branch or ref
statusString -Filter by pipeline status (running, pending, success, failed, canceled, skipped, created, manual)
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 list-gitlab-pipelines --repository string --token env:MYSECRET
func (m *MyModule) Example(ctx context.Context, repository string, token *dagger.Secret) string  {
	return dag.
			Gitlab().
			ListGitlabPipelines(ctx, repository, token)
}
@function
async def example(repository: str, token: dagger.Secret) -> str:
	return await (
		dag.gitlab()
		.list_gitlab_pipelines(repository, token)
	)
@func()
async example(repository: string, token: Secret): Promise<string> {
	return dag
		.gitlab()
		.listGitlabPipelines(repository, token)
}

listMergeRequestChanges() 🔗

ListMergeRequestChanges lists changed files between MR source and target branch

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
serverString !-No description provided
tokenSecret !-No description provided
projectIdString !-No description provided
mergeRequestIdString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 list-merge-request-changes --server string --token env:MYSECRET --project-id string --merge-request-id string
func (m *MyModule) Example(ctx context.Context, server string, token *dagger.Secret, projectId string, mergeRequestId string) []string  {
	return dag.
			Gitlab().
			ListMergeRequestChanges(ctx, server, token, projectId, mergeRequestId)
}
@function
async def example(server: str, token: dagger.Secret, project_id: str, merge_request_id: str) -> List[str]:
	return await (
		dag.gitlab()
		.list_merge_request_changes(server, token, project_id, merge_request_id)
	)
@func()
async example(server: string, token: Secret, projectId: string, mergeRequestId: string): Promise<string[]> {
	return dag
		.gitlab()
		.listMergeRequestChanges(server, token, projectId, mergeRequestId)
}

listMergeRequests() 🔗

ListMergeRequests fetches all MRs for a given project

Return Type
String !
Arguments
NameTypeDefault ValueDescription
serverString !-No description provided
tokenSecret !-No description provided
projectIdString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 list-merge-requests --server string --token env:MYSECRET --project-id string
func (m *MyModule) Example(ctx context.Context, server string, token *dagger.Secret, projectId string) string  {
	return dag.
			Gitlab().
			ListMergeRequests(ctx, server, token, projectId)
}
@function
async def example(server: str, token: dagger.Secret, project_id: str) -> str:
	return await (
		dag.gitlab()
		.list_merge_requests(server, token, project_id)
	)
@func()
async example(server: string, token: Secret, projectId: string): Promise<string> {
	return dag
		.gitlab()
		.listMergeRequests(server, token, projectId)
}

listProjects() 🔗

ListProjects lists all projects in a given group (with pagination)

Return Type
String !
Arguments
NameTypeDefault ValueDescription
serverString !-No description provided
tokenSecret !-No description provided
groupPathString !-already escaped: "Lab%2Fstuttgart-things%2Fidp"
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 list-projects --server string --token env:MYSECRET --group-path string
func (m *MyModule) Example(ctx context.Context, server string, token *dagger.Secret, groupPath string) string  {
	return dag.
			Gitlab().
			ListProjects(ctx, server, token, groupPath)
}
@function
async def example(server: str, token: dagger.Secret, group_path: str) -> str:
	return await (
		dag.gitlab()
		.list_projects(server, token, group_path)
	)
@func()
async example(server: string, token: Secret, groupPath: string): Promise<string> {
	return dag
		.gitlab()
		.listProjects(server, token, groupPath)
}

printMergeRequestFileChanges() 🔗

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
repoUrlString !-No description provided
serverString !-No description provided
tokenSecret !-No description provided
projectIdString !-No description provided
mergeRequestIdString !-No description provided
branchString !-No description provided
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 print-merge-request-file-changes --repo-url string --server string --token env:MYSECRET --project-id string --merge-request-id string --branch string
func (m *MyModule) Example(ctx context.Context, repoUrl string, server string, token *dagger.Secret, projectId string, mergeRequestId string, branch string)   {
	return dag.
			Gitlab().
			PrintMergeRequestFileChanges(ctx, repoUrl, server, token, projectId, mergeRequestId, branch)
}
@function
async def example(repo_url: str, server: str, token: dagger.Secret, project_id: str, merge_request_id: str, branch: str) -> None:
	return await (
		dag.gitlab()
		.print_merge_request_file_changes(repo_url, server, token, project_id, merge_request_id, branch)
	)
@func()
async example(repoUrl: string, server: string, token: Secret, projectId: string, mergeRequestId: string, branch: string): Promise<void> {
	return dag
		.gitlab()
		.printMergeRequestFileChanges(repoUrl, server, token, projectId, mergeRequestId, branch)
}

updateMergeRequestState() 🔗

UpdateMergeRequestState updates the state of a Merge Request (e.g., merge, close)

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
serverString !-No description provided
tokenSecret !-No description provided
projectIdString !-No description provided
mergeRequestIdString !-No description provided
actionString !-"merge" or "close"
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 update-merge-request-state --server string --token env:MYSECRET --project-id string --merge-request-id string --action string
func (m *MyModule) Example(ctx context.Context, server string, token *dagger.Secret, projectId string, mergeRequestId string, action string)   {
	return dag.
			Gitlab().
			UpdateMergeRequestState(ctx, server, token, projectId, mergeRequestId, action)
}
@function
async def example(server: str, token: dagger.Secret, project_id: str, merge_request_id: str, action: str) -> None:
	return await (
		dag.gitlab()
		.update_merge_request_state(server, token, project_id, merge_request_id, action)
	)
@func()
async example(server: string, token: Secret, projectId: string, mergeRequestId: string, action: string): Promise<void> {
	return dag
		.gitlab()
		.updateMergeRequestState(server, token, projectId, mergeRequestId, action)
}

waitForGitlabPipeline() 🔗

WaitForGitlabPipeline waits for a GitLab pipeline to reach a terminal state (success, failed, canceled, or skipped) by polling the GitLab API. Returns the full pipeline JSON response once the pipeline completes.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-GitLab project path in format "group/project" or "group/subgroup/project"
pipelineIdString !-Pipeline ID to wait for
tokenSecret !-GitLab token for authentication
gitlabHostString "gitlab.com"GitLab host (e.g., "gitlab.com" or custom instance)
intervalInteger 10Polling interval in seconds
timeoutInteger 600Timeout in seconds
Example
dagger -m github.com/stuttgart-things/dagger/gitlab@71f480dc5edb656e9afa96d86f234ebd154737b8 call \
 wait-for-gitlab-pipeline --repository string --pipeline-id string --token env:MYSECRET
func (m *MyModule) Example(ctx context.Context, repository string, pipelineId string, token *dagger.Secret) string  {
	return dag.
			Gitlab().
			WaitForGitlabPipeline(ctx, repository, pipelineId, token)
}
@function
async def example(repository: str, pipeline_id: str, token: dagger.Secret) -> str:
	return await (
		dag.gitlab()
		.wait_for_gitlab_pipeline(repository, pipeline_id, token)
	)
@func()
async example(repository: string, pipelineId: string, token: Secret): Promise<string> {
	return dag
		.gitlab()
		.waitForGitlabPipeline(repository, pipelineId, token)
}