Dagger
Search

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@dd171cfe5a4fe1a3f9235c607e08ed826735473a

Entrypoint

Return Type
Version !
Arguments
NameTypeDefault ValueDescription
inputsDirectory -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
gitDirDirectory -No description provided
changesDirectory -.changes file used to extract version information
Example
dagger -m github.com/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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/shykes/dagger/version@dd171cfe5a4fe1a3f9235c607e08ed826735473a 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
NameTypeDefault ValueDescription
componentString -Optional component tag prefix
commitString -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
NameTypeDefault ValueDescription
componentString -Optional component tag prefix
commitString -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
NameTypeDefault ValueDescription
commitString -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
NameTypeDefault ValueDescription
refString !-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
NameTypeDefault ValueDescription
refString !-No description provided
ref2String !-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
NameTypeDefault ValueDescription
filenameString !-No description provided
refString !-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