Dagger
Search

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@69c1a1c6de5772201ddab5e1814fcfea2317b1ee

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/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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 🔗

gitDir() 🔗

Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git-dir
func (m *myModule) example() *Directory  {
	return dag.
			Version().
			GitDir()
}
@function
def example() -> dagger.Directory:
	return (
		dag.version()
		.git_dir()
	)
@func()
example(): Directory {
	return dag
		.version()
		.gitDir()
}

inputs() 🔗

Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 inputs
func (m *myModule) example() *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/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 changes
func (m *myModule) example() *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/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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() 🔗

Return Type
Git !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee 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()
}

Git 🔗

Git is an opinionated helper for performing various commands on our dagger repo.

container() 🔗

Return Type
Container !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 container
func (m *myModule) example() *Container  {
	return dag.
			Version().
			Git().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.version()
		.git()
		.container()
	)
@func()
example(): Container {
	return dag
		.version()
		.git()
		.container()
}

versionTagLatest() 🔗

VersionTagLatests gets the latest version tag for a given component

Return Type
Tag !
Arguments
NameTypeDefault ValueDescription
componentString -No description provided
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tag-latest
func (m *myModule) example() *VersionTag  {
	return dag.
			Version().
			Git().
			VersionTagLatest()
}
@function
def example() -> dag.VersionTag:
	return (
		dag.version()
		.git()
		.version_tag_latest()
	)
@func()
example(): VersionTag {
	return dag
		.version()
		.git()
		.versionTagLatest()
}

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 -No description provided
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tags
func (m *myModule) example() []*VersionTag  {
	return dag.
			Version().
			Git().
			VersionTags()
}
@function
def example() -> List[dag.VersionTag]:
	return (
		dag.version()
		.git()
		.version_tags()
	)
@func()
example(): VersionTag[] {
	return dag
		.version()
		.git()
		.versionTags()
}

head() 🔗

Return Type
Commit !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 head
func (m *myModule) example() *VersionCommit  {
	return dag.
			Version().
			Git().
			Head()
}
@function
def example() -> dag.VersionCommit:
	return (
		dag.version()
		.git()
		.head()
	)
@func()
example(): VersionCommit {
	return dag
		.version()
		.git()
		.head()
}

commit() 🔗

Return Type
Commit !
Arguments
NameTypeDefault ValueDescription
refString !-No description provided
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 commit --ref string
func (m *myModule) example(ref string) *VersionCommit  {
	return dag.
			Version().
			Git().
			Commit(ref)
}
@function
def example(ref: str) -> dag.VersionCommit:
	return (
		dag.version()
		.git()
		.commit(ref)
	)
@func()
example(ref: string): VersionCommit {
	return dag
		.version()
		.git()
		.commit(ref)
}

mergeBase() 🔗

Return Type
Commit !
Arguments
NameTypeDefault ValueDescription
refString !-No description provided
ref2String !-No description provided
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 merge-base --ref string --ref-2 string
func (m *myModule) example(ref string, ref2 string) *VersionCommit  {
	return dag.
			Version().
			Git().
			MergeBase(ref, ref2)
}
@function
def example(ref: str, ref2: str) -> dag.VersionCommit:
	return (
		dag.version()
		.git()
		.merge_base(ref, ref2)
	)
@func()
example(ref: string, ref2: string): VersionCommit {
	return dag
		.version()
		.git()
		.mergeBase(ref, ref2)
}

dirty() 🔗

Return whether the current git state is dirty

Return Type
Boolean !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 dirty
func (m *myModule) example(ctx context.Context) bool  {
	return dag.
			Version().
			Git().
			Dirty(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.version()
		.git()
		.dirty()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.version()
		.git()
		.dirty()
}

Tag 🔗

component() 🔗

The component this belongs to.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tag-latest \
 component
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Version().
			Git().
			VersionTagLatest().
			Component(ctx)
}
@function
async def example() -> str:
	return await (
		dag.version()
		.git()
		.version_tag_latest()
		.component()
	)
@func()
async example(): Promise<string> {
	return dag
		.version()
		.git()
		.versionTagLatest()
		.component()
}

version() 🔗

The semver version for this component.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tag-latest \
 version
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Version().
			Git().
			VersionTagLatest().
			Version(ctx)
}
@function
async def example() -> str:
	return await (
		dag.version()
		.git()
		.version_tag_latest()
		.version()
	)
@func()
async example(): Promise<string> {
	return dag
		.version()
		.git()
		.versionTagLatest()
		.version()
}

commit() 🔗

The commit hash.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tag-latest \
 commit
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Version().
			Git().
			VersionTagLatest().
			Commit(ctx)
}
@function
async def example() -> str:
	return await (
		dag.version()
		.git()
		.version_tag_latest()
		.commit()
	)
@func()
async example(): Promise<string> {
	return dag
		.version()
		.git()
		.versionTagLatest()
		.commit()
}

date() 🔗

The tag creator date. Distinct from author date, and not to be confused with the underlying commit date.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 version-tag-latest \
 date
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Version().
			Git().
			VersionTagLatest().
			Date(ctx)
}
@function
async def example() -> str:
	return await (
		dag.version()
		.git()
		.version_tag_latest()
		.date()
	)
@func()
async example(): Promise<string> {
	return dag
		.version()
		.git()
		.versionTagLatest()
		.date()
}

Commit 🔗

commit() 🔗

The commit hash.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 merge-base --ref string --ref-2 string \
 commit
func (m *myModule) example(ctx context.Context, ref string, ref2 string) string  {
	return dag.
			Version().
			Git().
			MergeBase(ref, ref2).
			Commit(ctx)
}
@function
async def example(ref: str, ref2: str) -> str:
	return await (
		dag.version()
		.git()
		.merge_base(ref, ref2)
		.commit()
	)
@func()
async example(ref: string, ref2: string): Promise<string> {
	return dag
		.version()
		.git()
		.mergeBase(ref, ref2)
		.commit()
}

date() 🔗

The commit commit date. Distinct from the author date.

Return Type
String !
Example
dagger -m github.com/dagger/dagger/version@69c1a1c6de5772201ddab5e1814fcfea2317b1ee call \
 git \
 merge-base --ref string --ref-2 string \
 date
func (m *myModule) example(ctx context.Context, ref string, ref2 string) string  {
	return dag.
			Version().
			Git().
			MergeBase(ref, ref2).
			Date(ctx)
}
@function
async def example(ref: str, ref2: str) -> str:
	return await (
		dag.version()
		.git()
		.merge_base(ref, ref2)
		.date()
	)
@func()
async example(ref: string, ref2: string): Promise<string> {
	return dag
		.version()
		.git()
		.mergeBase(ref, ref2)
		.date()
}