version
In general, it attempts to follow go's psedudoversioning:https://go.dev/doc/modules/version-numbers
Installation
dagger install github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115Entrypoint
Return Type
Version !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| inputs | Directory | - | A directory containing all the inputs of the artifact to be versioned. An input is any file that changes the artifact if it changes. This directory is used to compute a digest. If any input changes, the digest changes. - To avoid false positives, only include actual inputs - To avoid false negatives, include *all* inputs |
| gitDir | Directory | - | No description provided |
| changes | Directory | - | .changes file used to extract version information |
Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
func (m *MyModule) Example() *dagger.Version {
return dag.
Version()
}@function
def example() -> dagger.Version:
return (
dag.version()
)@func()
example(): Version {
return dag
.version()
}Types
Version 🔗
git() 🔗
Return Type
Git ! Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
gitfunc (m *MyModule) Example() *dagger.VersionGit {
return dag.
Version().
Git()
}@function
def example() -> dagger.VersionGit:
return (
dag.version()
.git()
)@func()
example(): VersionGit {
return dag
.version()
.git()
}version() 🔗
Generate a version string from the current context
Return Type
String ! Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
versionfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Version().
Version(ctx)
}@function
async def example() -> str:
return await (
dag.version()
.version()
)@func()
async example(): Promise<string> {
return dag
.version()
.version()
}imageTag() 🔗
Return the tag to use when auto-downloading the engine image from the CLI
Return Type
String ! Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
image-tagfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Version().
ImageTag(ctx)
}@function
async def example() -> str:
return await (
dag.version()
.image_tag()
)@func()
async example(): Promise<string> {
return dag
.version()
.imageTag()
}lastReleaseVersion() 🔗
Determine the last released version.
Return Type
String ! Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
last-release-versionfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Version().
LastReleaseVersion(ctx)
}@function
async def example() -> str:
return await (
dag.version()
.last_release_version()
)@func()
async example(): Promise<string> {
return dag
.version()
.lastReleaseVersion()
}nextReleaseVersion() 🔗
Determine the “next” version to be released.
It first attempts to use the version in .changes/.next, but if this fails, or that version seems to have already been released, then we automagically calculate the next patch release in the current series.
Return Type
String ! Example
dagger -m github.com/Klomgor/dagger/version@000dcbce85be95fe5954cda7611efda0bb1bb115 call \
next-release-versionfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Version().
NextReleaseVersion(ctx)
}@function
async def example() -> str:
return await (
dag.version()
.next_release_version()
)@func()
async example(): Promise<string> {
return dag
.version()
.nextReleaseVersion()
}Git 🔗
Git is an opinionated helper for performing various commands on our dagger repo.
directory() 🔗
Return Type
Directory ! Example
Function VersionGit.directory is not accessible from the version moduleFunction VersionGit.directory is not accessible from the version moduleFunction VersionGit.directory is not accessible from the version moduleFunction VersionGit.directory is not accessible from the version moduleversionTagLatest() 🔗
VersionTagLatest gets the latest version tag for a given component
Return Type
Tag !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| component | String | - | Optional component tag prefix |
| commit | String | - | Optional commit sha to get tags for |
Example
Function VersionGit.versionTagLatest is not accessible from the version moduleFunction VersionGit.versionTagLatest is not accessible from the version moduleFunction VersionGit.versionTagLatest is not accessible from the version moduleFunction VersionGit.versionTagLatest is not accessible from the version moduleversionTags() 🔗
VersionTags gets all version tags for a given component - the resulting versions are sorted in ascending order
Return Type
[Tag ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| component | String | - | Optional component tag prefix |
| commit | String | - | Optional commit sha to get tags for |
Example
Function VersionGit.versionTags is not accessible from the version moduleFunction VersionGit.versionTags is not accessible from the version moduleFunction VersionGit.versionTags is not accessible from the version moduleFunction VersionGit.versionTags is not accessible from the version modulebranches() 🔗
Return Type
[Branch ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| commit | String | - | Optional commit sha to get branches for |
Example
Function VersionGit.branches is not accessible from the version moduleFunction VersionGit.branches is not accessible from the version moduleFunction VersionGit.branches is not accessible from the version moduleFunction VersionGit.branches is not accessible from the version modulehead() 🔗
Return Type
Commit ! Example
Function VersionGit.head is not accessible from the version moduleFunction VersionGit.head is not accessible from the version moduleFunction VersionGit.head is not accessible from the version moduleFunction VersionGit.head is not accessible from the version modulecommit() 🔗
Return Type
Commit !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | No description provided |
Example
Function VersionGit.commit is not accessible from the version moduleFunction VersionGit.commit is not accessible from the version moduleFunction VersionGit.commit is not accessible from the version moduleFunction VersionGit.commit is not accessible from the version modulemergeBase() 🔗
Return Type
Commit !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | No description provided |
| ref2 | String ! | - | No description provided |
Example
Function VersionGit.mergeBase is not accessible from the version moduleFunction VersionGit.mergeBase is not accessible from the version moduleFunction VersionGit.mergeBase is not accessible from the version moduleFunction VersionGit.mergeBase is not accessible from the version moduledirty() 🔗
Return whether the current git state is dirty
Return Type
Boolean ! Example
Function VersionGit.dirty is not accessible from the version moduleFunction VersionGit.dirty is not accessible from the version moduleFunction VersionGit.dirty is not accessible from the version moduleFunction VersionGit.dirty is not accessible from the version modulefileAt() 🔗
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| filename | String ! | - | No description provided |
| ref | String ! | - | No description provided |
Example
Function VersionGit.fileAt is not accessible from the version moduleFunction VersionGit.fileAt is not accessible from the version moduleFunction VersionGit.fileAt is not accessible from the version moduleFunction VersionGit.fileAt is not accessible from the version moduleTag 🔗
tag() 🔗
The raw tag
Return Type
String ! Example
Function VersionTag.tag is not accessible from the version moduleFunction VersionTag.tag is not accessible from the version moduleFunction VersionTag.tag is not accessible from the version moduleFunction VersionTag.tag is not accessible from the version modulecomponent() 🔗
The component this belongs to.
Return Type
String ! Example
Function VersionTag.component is not accessible from the version moduleFunction VersionTag.component is not accessible from the version moduleFunction VersionTag.component is not accessible from the version moduleFunction VersionTag.component is not accessible from the version moduleversion() 🔗
The semver version for this component.
Return Type
String ! Example
Function VersionTag.version is not accessible from the version moduleFunction VersionTag.version is not accessible from the version moduleFunction VersionTag.version is not accessible from the version moduleFunction VersionTag.version is not accessible from the version modulecommit() 🔗
The commit hash.
Return Type
String ! Example
Function VersionTag.commit is not accessible from the version moduleFunction VersionTag.commit is not accessible from the version moduleFunction VersionTag.commit is not accessible from the version moduleFunction VersionTag.commit is not accessible from the version moduledate() 🔗
The creator date. Distinct from author date, and not to be confused with the underlying commit date.
Return Type
String ! Example
Function VersionTag.date is not accessible from the version moduleFunction VersionTag.date is not accessible from the version moduleFunction VersionTag.date is not accessible from the version moduleFunction VersionTag.date is not accessible from the version moduleBranch 🔗
branch() 🔗
The raw branch
Return Type
String ! Example
Function VersionBranch.branch is not accessible from the version moduleFunction VersionBranch.branch is not accessible from the version moduleFunction VersionBranch.branch is not accessible from the version moduleFunction VersionBranch.branch is not accessible from the version modulecommit() 🔗
The commit hash.
Return Type
String ! Example
Function VersionBranch.commit is not accessible from the version moduleFunction VersionBranch.commit is not accessible from the version moduleFunction VersionBranch.commit is not accessible from the version moduleFunction VersionBranch.commit is not accessible from the version moduleCommit 🔗
commit() 🔗
The commit hash.
Return Type
String ! Example
Function VersionCommit.commit is not accessible from the version moduleFunction VersionCommit.commit is not accessible from the version moduleFunction VersionCommit.commit is not accessible from the version moduleFunction VersionCommit.commit is not accessible from the version moduledate() 🔗
The commit commit date. Distinct from the author date.
Return Type
String ! Example
Function VersionCommit.date is not accessible from the version moduleFunction VersionCommit.date is not accessible from the version moduleFunction VersionCommit.date is not accessible from the version moduleFunction VersionCommit.date is not accessible from the version module