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/riftonix/daggerverse/git@v0.1.0Entrypoint
Return Type
Git !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository directory (must include .git) |
| imageRegistry | String | "docker.io" | Git image registry |
| imageRepository | String | "alpine/git" | Git image repositroy |
| imageTag | String | "2.52.0" | Git image tag |
| containerUser | String | "65532" | Git image user |
Example
dagger -m github.com/riftonix/daggerverse/git@359166fabf6f48ad465903ee2556548f7c60e163 call \
--source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Git {
return dag.
Git(source)
}@function
def example(source: dagger.Directory, ) -> dagger.Git:
return (
dag.git(source)
)@func()
example(source: Directory, ): Git {
return dag
.git(source)
}Types
Git 🔗
container() 🔗
Creates container with configured git
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/git@359166fabf6f48ad465903ee2556548f7c60e163 call \
--source DIR_PATH containerfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Git(source).
Container()
}@function
def example(source: dagger.Directory, ) -> dagger.Container:
return (
dag.git(source)
.container()
)@func()
example(source: Directory, ): Container {
return dag
.git(source)
.container()
}getChangedDirs() 🔗
Return changed paths inside diff_dir between target_branch and HEAD
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| targetBranch | String ! | "master" | Target branch or ref to diff against |
| diffDir | String | "." | Subdirectory to scope the diff |
Example
dagger -m github.com/riftonix/daggerverse/git@359166fabf6f48ad465903ee2556548f7c60e163 call \
--source DIR_PATH get-changed-dirs --target-branch stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, targetBranch string) []string {
return dag.
Git(source).
GetChangedDirs(ctx, targetBranch)
}@function
async def example(source: dagger.Directory, target_branch: str) -> List[str]:
return await (
dag.git(source)
.get_changed_dirs(target_branch)
)@func()
async example(source: Directory, targetBranch: string): Promise<string[]> {
return dag
.git(source)
.getChangedDirs(targetBranch)
}