version
In general, it attempts to follow go's psedudoversioning:https://go.dev/doc/modules/version-numbers
Installation
dagger install github.com/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748fEntrypoint
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/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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()
}inputs() 🔗
Return Type
Directory ! Example
dagger -m github.com/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f call \
inputsfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Version().
Inputs()
}@function
def example() -> dagger.Directory:
return (
dag.version()
.inputs()
)@func()
example(): Directory {
return dag
.version()
.inputs()
}changes() 🔗
Return Type
Directory ! Example
dagger -m github.com/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f call \
changesfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Version().
Changes()
}@function
def example() -> dagger.Directory:
return (
dag.version()
.changes()
)@func()
example(): Directory {
return dag
.version()
.changes()
}version() 🔗
Generate a version string from the current context
Return Type
String ! Example
dagger -m github.com/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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/shykes/dagger/version@a5ea6e6a94d2afc84b695c6ca75fc8c6f3ae748f 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.
container() 🔗
Return Type
Container ! Example
Function VersionGit.container is not accessible from the version moduleFunction VersionGit.container is not accessible from the version moduleFunction VersionGit.container is not accessible from the version moduleFunction VersionGit.container is not accessible from the version modulevalid() 🔗
Return Type
Boolean ! Example
Function VersionGit.valid is not accessible from the version moduleFunction VersionGit.valid is not accessible from the version moduleFunction VersionGit.valid is not accessible from the version moduleFunction VersionGit.valid is not accessible from the version moduleversionTagLatest() 🔗
VersionTagLatests gets the latest version tag for a given component
Return Type
Tag !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| component | String | - | No description provided |
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 | - | No description provided |
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 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 🔗
component() 🔗
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 tag 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 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