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@18bd8d068ec2082875e730df3eff85eac5599231
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
func (m *myModule) example() *Version {
return dag.
Version()
}
Types
Version π
git() π
Return Type
Git !
Example
func (m *myModule) example() *VersionGit {
return dag.
Version().
Git()
}
version() π
Generate a version string from the current context
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
Version().
Version(ctx)
}
imageTag() π
Return the tag to use when auto-downloading the engine image from the CLI
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
Version().
ImageTag(ctx)
}
lastReleaseVersion() π
Determine the last released version.
Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string {
return dag.
Version().
LastReleaseVersion(ctx)
}
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
func (m *myModule) example(ctx context.Context) string {
return dag.
Version().
NextReleaseVersion(ctx)
}
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
versionTagLatest() π
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 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
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
head() π
Return Type
Commit !
Example
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
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
dirty() π
Return whether the current git state is dirty
Return Type
Boolean !
Example
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
Tag π
tag() π
The raw tag
Return Type
String !
Example
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
version() π
The semver version for this component.
Return Type
String !
Example
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
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
Branch π
branch() π
The raw branch
Return Type
String !
Example
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
Commit π
commit() π
The commit hash.
Return Type
String !
Example
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