git
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/disaster37/dagger-library-go/git@v0.0.20
Entrypoint
Return Type
Git !
Arguments
Name | Type | Description |
---|---|---|
baseContainer | Container | base container |
Example
dagger -m github.com/disaster37/dagger-library-go/git@7e7da44f35e584e7ff94bcea9b9885b8b397c138 call \
func (m *myModule) example() *Git {
return dag.
Git()
}
@function
def example() -> dag.Git:
return (
dag.git()
)
@func()
example(): Git {
return dag
.git()
}
Types
Git 🔗
baseContainer() 🔗
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/git@7e7da44f35e584e7ff94bcea9b9885b8b397c138 call \
base-container
func (m *myModule) example() *Container {
return dag.
Git().
BaseContainer()
}
@function
def example() -> dagger.Container:
return (
dag.git()
.base_container()
)
@func()
example(): Container {
return dag
.git()
.baseContainer()
}
getBaseContainer() 🔗
BaseContainer permit to get the base container
Return Type
Container !
Example
dagger -m github.com/disaster37/dagger-library-go/git@7e7da44f35e584e7ff94bcea9b9885b8b397c138 call \
get-base-container
func (m *myModule) example() *Container {
return dag.
Git().
GetBaseContainer()
}
@function
def example() -> dagger.Container:
return (
dag.git()
.get_base_container()
)
@func()
example(): Container {
return dag
.git()
.getBaseContainer()
}
setConfig() 🔗
SetConfig permit to set git config
Return Type
Git !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
username | String ! | - | The git username |
String ! | - | The git email |
Example
dagger -m github.com/disaster37/dagger-library-go/git@7e7da44f35e584e7ff94bcea9b9885b8b397c138 call \
set-config --username string --email string
func (m *myModule) example(username string, email string) *Git {
return dag.
Git().
SetConfig(username, email)
}
@function
def example(username: str, email: str) -> dag.Git:
return (
dag.git()
.set_config(username, email)
)
@func()
example(username: string, email: string): Git {
return dag
.git()
.setConfig(username, email)
}
commitAndPush() 🔗
CommitAndPush permit to commit and push
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | the source directory |
message | String ! | - | The commit message |
Example
dagger -m github.com/disaster37/dagger-library-go/git@7e7da44f35e584e7ff94bcea9b9885b8b397c138 call \
commit-and-push --source DIR_PATH --message string
func (m *myModule) example(ctx context.Context, source *Directory, message string) string {
return dag.
Git().
CommitAndPush(ctx, source, message)
}
@function
async def example(source: dagger.Directory, message: str) -> str:
return await (
dag.git()
.commit_and_push(source, message)
)
@func()
async example(source: Directory, message: string): Promise<string> {
return dag
.git()
.commitAndPush(source, message)
}