Dagger
Search

gitclient

A Dagger module providing authenticated Git-over-HTTPS clone operations.

Installation

dagger install github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c

Entrypoint

Return Type
Gitclient !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
func (m *MyModule) Example() *dagger.Gitclient  {
	return dag.
			Gitclient()
}
@function
def example() -> dagger.Gitclient:
	return (
		dag.gitclient()
	)
@func()
example(): Gitclient {
	return dag
		.gitclient()
}

Types

Repo 🔗

directory() 🔗

A directory.

Return Type
Directory !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 directory
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string) *dagger.Directory  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Directory()
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str) -> dagger.Directory:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.directory()
	)
@func()
example(repo: string, username: string, password: Secret, ref: string): Directory {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.directory()
}

repo() 🔗

Return Type
String !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 repo
func (m *MyModule) Example(ctx context.Context, repo string, username string, password *dagger.Secret, ref string) string  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Repo(ctx)
}
@function
async def example(repo: str, username: str, password: dagger.Secret, ref: str) -> str:
	return await (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.repo()
	)
@func()
async example(repo: string, username: string, password: Secret, ref: string): Promise<string> {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.repo()
}

username() 🔗

Return Type
String !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 username
func (m *MyModule) Example(ctx context.Context, repo string, username string, password *dagger.Secret, ref string) string  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Username(ctx)
}
@function
async def example(repo: str, username: str, password: dagger.Secret, ref: str) -> str:
	return await (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.username()
	)
@func()
async example(repo: string, username: string, password: Secret, ref: string): Promise<string> {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.username()
}

password() 🔗

A reference to a secret value, which can be handled more safely than the value itself.

Return Type
Secret !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 password
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string) *dagger.Secret  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Password()
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str) -> dagger.Secret:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.password()
	)
@func()
example(repo: string, username: string, password: Secret, ref: string): Secret {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.password()
}

addAll() 🔗

Stage all repository changes (git add -A).

Return Type
Repo !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 add-all
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string) *dagger.GitclientRepo  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			AddAll()
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str) -> dagger.GitclientRepo:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.add_all()
	)
@func()
example(repo: string, username: string, password: Secret, ref: string): GitclientRepo {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.addAll()
}

commit() 🔗

Create a commit for staged changes.

Return Type
Repo !
Arguments
NameTypeDefault ValueDescription
messageString !-No description provided
usernameString !-No description provided
emailString !-No description provided
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 commit --message string --username string --email string
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string, message string, username1 string, email string) *dagger.GitclientRepo  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Commit(message, username1, email)
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str, message: str, username1: str, email: str) -> dagger.GitclientRepo:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.commit(message, username1, email)
	)
@func()
example(repo: string, username: string, password: Secret, ref: string, message: string, username1: string, email: string): GitclientRepo {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.commit(message, username1, email)
}

push() 🔗

Push the current repository state and return the pushed commit SHA.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"No description provided
branchString !""No description provided
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 push --remote string --branch string
func (m *MyModule) Example(ctx context.Context, repo string, username string, password *dagger.Secret, ref string, remote string, branch string) string  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Push(ctx, remote, branch)
}
@function
async def example(repo: str, username: str, password: dagger.Secret, ref: str, remote: str, branch: str) -> str:
	return await (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.push(remote, branch)
	)
@func()
async example(repo: string, username: string, password: Secret, ref: string, remote: string, branch: string): Promise<string> {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.push(remote, branch)
}

updateWorktree() 🔗

Replace non-.git content while preserving existing .git metadata.

Return Type
Repo !
Arguments
NameTypeDefault ValueDescription
worktreeDirectory !-A directory.
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 update-worktree --worktree DIR_PATH
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string, worktree *dagger.Directory) *dagger.GitclientRepo  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			UpdateWorktree(worktree)
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str, worktree: dagger.Directory) -> dagger.GitclientRepo:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.update_worktree(worktree)
	)
@func()
example(repo: string, username: string, password: Secret, ref: string, worktree: Directory): GitclientRepo {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.updateWorktree(worktree)
}

worktree() 🔗

Return the repository contents without the .git directory.

Return Type
Directory !
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 worktree
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string) *dagger.Directory  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			Worktree()
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str) -> dagger.Directory:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.worktree()
	)
@func()
example(repo: string, username: string, password: Secret, ref: string): Directory {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.worktree()
}

writeFile() 🔗

Create or overwrite a file in the repository worktree.

Return Type
Repo !
Arguments
NameTypeDefault ValueDescription
pathString !-No description provided
contentString !-No description provided
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string \
 write-file --path string --content string
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string, path string, content string) *dagger.GitclientRepo  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref).
			WriteFile(path, content)
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str, path: str, content: str) -> dagger.GitclientRepo:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
		.write_file(path, content)
	)
@func()
example(repo: string, username: string, password: Secret, ref: string, path: string, content: string): GitclientRepo {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
		.writeFile(path, content)
}

Gitclient 🔗

clone() 🔗

Clone an HTTPS repository using username + PAT/password auth.

Return Type
Repo !
Arguments
NameTypeDefault ValueDescription
repoString !-No description provided
usernameString !-No description provided
passwordSecret !-A reference to a secret value, which can be handled more safely than the value itself.
refString !"main"No description provided
Example
dagger -m github.com/ajaegle/daggerverse/gitclient@e5837a01801532d8d3f814cf5c867b609530974c call \
 clone --repo string --username string --password env:MYSECRET --ref string
func (m *MyModule) Example(repo string, username string, password *dagger.Secret, ref string) *dagger.GitclientRepo  {
	return dag.
			Gitclient().
			Clone(repo, username, password, ref)
}
@function
def example(repo: str, username: str, password: dagger.Secret, ref: str) -> dagger.GitclientRepo:
	return (
		dag.gitclient()
		.clone(repo, username, password, ref)
	)
@func()
example(repo: string, username: string, password: Secret, ref: string): GitclientRepo {
	return dag
		.gitclient()
		.clone(repo, username, password, ref)
}