Dagger
Search

private-git

A module to help you easily perform clone, push, and pull operations on your private git.

Installation

dagger install github.com/seungyeop-lee/daggerverse/private-git@v0.3.2

Entrypoint

Return Type
PrivateGit !
Arguments
NameTypeDefault ValueDescription
baseCtrContainer -base container
Example
func (m *myModule) example() *PrivateGit  {
	return dag.
			PrivateGit()
}

Types

PrivateGit πŸ”—

PrivateGit dagger module

baseContainer() πŸ”—

Get the base container for the PrivateGit module. Used when you need to inject a Service into a BaseContainer and run it.

Example:

dag.PrivateGit(PrivateGitOpts{
	BaseCtr: dag.PrivateGit().BaseContainer().WithServiceBinding("gitea", git),
})...

Note: As of v0.11.2, passing a Service directly as a parameter to an external dagger function would not bind to the container created inside the dagger function.

Return Type
Container !
Example
func (m *myModule) example() *Container  {
	return dag.
			PrivateGit().
			BaseContainer()
}

repo() πŸ”—

Set up an existing repository folder.

Return Type
PrivateGitRepo !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
Example
func (m *myModule) example(dir *Directory) *PrivateGitRepo  {
	return dag.
			PrivateGit().
			Repo(dir)
}

withSshKey() πŸ”—

Set the ssh key.

Note: Tested against RSA-formatted and OPENSSH-formatted private keys.

Return Type
PrivateGitSsh !
Arguments
NameTypeDefault ValueDescription
sshKeySecret !-ssk key file
Example
func (m *myModule) example(sshKey *Secret) *PrivateGitSsh  {
	return dag.
			PrivateGit().
			WithSshKey(sshKey)
}

withUserPassword() πŸ”—

Set up user and password information.

Return Type
PrivateGitHttp !
Arguments
NameTypeDefault ValueDescription
usernameString !-No description provided
passwordSecret !-No description provided
Example
func (m *myModule) example(username string, password *Secret) *PrivateGitHttp  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password)
}

PrivateGitRepo πŸ”—

Working with private Git repositories

container() πŸ”—

Returns the container with RepoDir.

Return Type
Container !
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *Container  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone().
			Container()
}

directory() πŸ”—

Returns the repository.

Return Type
Directory !
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *Directory  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone().
			Directory()
}

setConfig() πŸ”—

Set the user’s name and email.

Return Type
PrivateGitRepo !
Arguments
NameTypeDefault ValueDescription
userNameString !-No description provided
userEmailString !-No description provided
Example
func (m *myModule) example(username string, password *Secret, webUrl string, userName string, userEmail string) *PrivateGitRepo  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone().
			SetConfig(userName, userEmail)
}

push() πŸ”—

Push the repository.

Return Type
Container !
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *Container  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone().
			Push()
}

pull() πŸ”—

Pull the repository.

Return Type
Directory !
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *Directory  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone().
			Pull()
}

PrivateGitSsh πŸ”—

PrivateGit with SSH settings

withRepoUrl() πŸ”—

Set the SSH URL of the target repository.

Return Type
PrivateGitRepoUrl !
Arguments
NameTypeDefault ValueDescription
sshUrlString !-No description provided
Example
func (m *myModule) example(sshKey *Secret, sshUrl string) *PrivateGitRepoUrl  {
	return dag.
			PrivateGit().
			WithSshKey(sshKey).
			WithRepoUrl(sshUrl)
}

repo() πŸ”—

Set up an existing repository folder.

Return Type
PrivateGitRepo !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
Example
func (m *myModule) example(sshKey *Secret, dir *Directory) *PrivateGitRepo  {
	return dag.
			PrivateGit().
			WithSshKey(sshKey).
			Repo(dir)
}

PrivateGitHttp πŸ”—

PrivateGit with user and password information added

withRepoUrl() πŸ”—

Set the Web URL of the target repository.

Return Type
PrivateGitRepoUrl !
Arguments
NameTypeDefault ValueDescription
webUrlString !-No description provided
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *PrivateGitRepoUrl  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl)
}

PrivateGitRepoUrl πŸ”—

PrivateGit with target Repositorydml URL information added

clone() πŸ”—

Clone the Git repository.

Return Type
PrivateGitRepo !
Example
func (m *myModule) example(username string, password *Secret, webUrl string) *PrivateGitRepo  {
	return dag.
			PrivateGit().
			WithUserPassword(username, password).
			WithRepoUrl(webUrl).
			Clone()
}