version
In general, it attempts to follow go's psedudoversioning:https://go.dev/doc/modules/version-numbers
Installation
dagger install github.com/dagger/dagger/version@v0.15.1
Entrypoint
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/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
func (m *myModule) example() *Version {
return dag.
Version()
}
@function
def example() -> dag.Version:
return (
dag.version()
)
@func()
example(): Version {
return dag
.version()
}
Types
Version 🔗
git() 🔗
Return Type
Git !
Example
dagger -m github.com/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
git
func (m *myModule) example() *VersionGit {
return dag.
Version().
Git()
}
@function
def example() -> dag.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/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
version
func (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/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
image-tag
func (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/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
last-release-version
func (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/dagger/dagger/version@196f232a4d6b2d1d3db5f5e040cf20b6a76a76c5 call \
next-release-version
func (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 module
Function VersionGit.directory is not accessible from the version module
Function VersionGit.directory is not accessible from the version module
Function VersionGit.directory is not accessible from the version module
versionTagLatest() 🔗
VersionTagLatests 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 module
Function VersionGit.versionTagLatest is not accessible from the version module
Function VersionGit.versionTagLatest is not accessible from the version module
Function VersionGit.versionTagLatest is not accessible from the version module
versionTags() 🔗
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 module
Function VersionGit.versionTags is not accessible from the version module
Function VersionGit.versionTags is not accessible from the version module
Function VersionGit.versionTags is not accessible from the version module
branches() 🔗
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 module
Function VersionGit.branches is not accessible from the version module
Function VersionGit.branches is not accessible from the version module
Function VersionGit.branches is not accessible from the version module
head() 🔗
Return Type
Commit !
Example
Function VersionGit.head is not accessible from the version module
Function VersionGit.head is not accessible from the version module
Function VersionGit.head is not accessible from the version module
Function VersionGit.head is not accessible from the version module
commit() 🔗
Return Type
Commit !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ref | String ! | - | No description provided |
Example
Function VersionGit.commit is not accessible from the version module
Function VersionGit.commit is not accessible from the version module
Function VersionGit.commit is not accessible from the version module
Function VersionGit.commit is not accessible from the version module
mergeBase() 🔗
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 module
Function VersionGit.mergeBase is not accessible from the version module
Function VersionGit.mergeBase is not accessible from the version module
Function VersionGit.mergeBase is not accessible from the version module
dirty() 🔗
Return whether the current git state is dirty
Return Type
Boolean !
Example
Function VersionGit.dirty is not accessible from the version module
Function VersionGit.dirty is not accessible from the version module
Function VersionGit.dirty is not accessible from the version module
Function VersionGit.dirty is not accessible from the version module
fileAt() 🔗
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 module
Function VersionGit.fileAt is not accessible from the version module
Function VersionGit.fileAt is not accessible from the version module
Function VersionGit.fileAt is not accessible from the version module
Tag 🔗
tag() 🔗
The raw tag
Return Type
String !
Example
Function VersionTag.tag is not accessible from the version module
Function VersionTag.tag is not accessible from the version module
Function VersionTag.tag is not accessible from the version module
Function VersionTag.tag is not accessible from the version module
component() 🔗
The component this belongs to.
Return Type
String !
Example
Function VersionTag.component is not accessible from the version module
Function VersionTag.component is not accessible from the version module
Function VersionTag.component is not accessible from the version module
Function VersionTag.component is not accessible from the version module
version() 🔗
The semver version for this component.
Return Type
String !
Example
Function VersionTag.version is not accessible from the version module
Function VersionTag.version is not accessible from the version module
Function VersionTag.version is not accessible from the version module
Function VersionTag.version is not accessible from the version module
commit() 🔗
The commit hash.
Return Type
String !
Example
Function VersionTag.commit is not accessible from the version module
Function VersionTag.commit is not accessible from the version module
Function VersionTag.commit is not accessible from the version module
Function VersionTag.commit is not accessible from the version module
date() 🔗
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 module
Function VersionTag.date is not accessible from the version module
Function VersionTag.date is not accessible from the version module
Function VersionTag.date is not accessible from the version module
Branch 🔗
branch() 🔗
The raw branch
Return Type
String !
Example
Function VersionBranch.branch is not accessible from the version module
Function VersionBranch.branch is not accessible from the version module
Function VersionBranch.branch is not accessible from the version module
Function VersionBranch.branch is not accessible from the version module
commit() 🔗
The commit hash.
Return Type
String !
Example
Function VersionBranch.commit is not accessible from the version module
Function VersionBranch.commit is not accessible from the version module
Function VersionBranch.commit is not accessible from the version module
Function VersionBranch.commit is not accessible from the version module
Commit 🔗
commit() 🔗
The commit hash.
Return Type
String !
Example
Function VersionCommit.commit is not accessible from the version module
Function VersionCommit.commit is not accessible from the version module
Function VersionCommit.commit is not accessible from the version module
Function VersionCommit.commit is not accessible from the version module
date() 🔗
The commit commit date. Distinct from the author date.
Return Type
String !
Example
Function VersionCommit.date is not accessible from the version module
Function VersionCommit.date is not accessible from the version module
Function VersionCommit.date is not accessible from the version module
Function VersionCommit.date is not accessible from the version module