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
Name | Type | Default Value | Description |
---|---|---|---|
baseCtr | Container | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
sshKey | Secret ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
username | String ! | - | No description provided |
password | Secret ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
userName | String ! | - | No description provided |
userEmail | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
sshUrl | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
webUrl | String ! | - | 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()
}