versioner
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/felipepimentel/daggerverse/versioner@v1.0.0
Entrypoint
Return Type
Versioner
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
func (m *myModule) example() *Versioner {
return dag.
Versioner()
}
@function
def example() -> dag.Versioner:
return (
dag.versioner()
)
@func()
example(): Versioner {
return dag
.versioner()
}
Types
Versioner 🔗
Versioner manages semantic versioning for projects
config() 🔗
Configuration for versioning
Return Type
VersionConfig !
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
config
func (m *myModule) example() *VersionerVersionConfig {
return dag.
Versioner().
Config()
}
@function
def example() -> dag.VersionerVersionConfig:
return (
dag.versioner()
.config()
)
@func()
example(): VersionerVersionConfig {
return dag
.versioner()
.config()
}
withConfig() 🔗
WithConfig sets the configuration
Return Type
Versioner !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
config | VersionConfig ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(config *VersionerVersionConfig) *Versioner {
return dag.
Versioner().
WithConfig(config)
}
@function
def example(config: dag.VersionerVersionConfig) -> dag.Versioner:
return (
dag.versioner()
.with_config(config)
)
@func()
example(config: VersionerVersionConfig): Versioner {
return dag
.versioner()
.withConfig(config)
}
getCurrentVersion() 🔗
GetCurrentVersion retrieves the current version from source code
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
get-current-version --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Versioner().
GetCurrentVersion(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
return await (
dag.versioner()
.get_current_version(source)
)
@func()
async example(source: Directory): Promise<string> {
return dag
.versioner()
.getCurrentVersion(source)
}
bumpVersion() 🔗
BumpVersion increments the version based on commit messages
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
bump-version --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Versioner().
BumpVersion(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
return await (
dag.versioner()
.bump_version(source)
)
@func()
async example(source: Directory): Promise<string> {
return dag
.versioner()
.bumpVersion(source)
}
validateCommitMessage() 🔗
ValidateCommitMessage checks if a commit message follows the conventional commit format
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
message | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
validate-commit-message --message string
func (m *myModule) example(ctx context.Context, message string) {
return dag.
Versioner().
ValidateCommitMessage(ctx, message)
}
@function
async def example(message: str) -> None:
return await (
dag.versioner()
.validate_commit_message(message)
)
@func()
async example(message: string): Promise<void> {
return dag
.versioner()
.validateCommitMessage(message)
}
pushChanges() 🔗
PushChanges commits and pushes version changes
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
version | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
push-changes --source DIR_PATH --version string
func (m *myModule) example(ctx context.Context, source *Directory, version string) {
return dag.
Versioner().
PushChanges(ctx, source, version)
}
@function
async def example(source: dagger.Directory, version: str) -> None:
return await (
dag.versioner()
.push_changes(source, version)
)
@func()
async example(source: Directory, version: string): Promise<void> {
return dag
.versioner()
.pushChanges(source, version)
}
getVersionHistory() 🔗
GetVersionHistory returns a list of all versions with their commit messages
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/versioner@e8ebc30bb8c87278147f856c9d8b0e09addbcb74 call \
get-version-history --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Versioner().
GetVersionHistory(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
return await (
dag.versioner()
.get_version_history(source)
)
@func()
async example(source: Directory): Promise<string> {
return dag
.versioner()
.getVersionHistory(source)
}
VersionConfig 🔗
VersionConfig holds configuration for version management
strategy() 🔗
Strategy for versioning (default: “semver”)
Return Type
String !
Example
Function VersionerVersionConfig.strategy is not accessible from the versioner module
Function VersionerVersionConfig.strategy is not accessible from the versioner module
Function VersionerVersionConfig.strategy is not accessible from the versioner module
Function VersionerVersionConfig.strategy is not accessible from the versioner module
tagPrefix() 🔗
Prefix for version tags (default: “v”)
Return Type
String !
Example
Function VersionerVersionConfig.tagPrefix is not accessible from the versioner module
Function VersionerVersionConfig.tagPrefix is not accessible from the versioner module
Function VersionerVersionConfig.tagPrefix is not accessible from the versioner module
Function VersionerVersionConfig.tagPrefix is not accessible from the versioner module
versionFiles() 🔗
Files to check for version patterns
Return Type
[String ! ] !
Example
Function VersionerVersionConfig.versionFiles is not accessible from the versioner module
Function VersionerVersionConfig.versionFiles is not accessible from the versioner module
Function VersionerVersionConfig.versionFiles is not accessible from the versioner module
Function VersionerVersionConfig.versionFiles is not accessible from the versioner module
versionPattern() 🔗
Custom version pattern regex
Return Type
String !
Example
Function VersionerVersionConfig.versionPattern is not accessible from the versioner module
Function VersionerVersionConfig.versionPattern is not accessible from the versioner module
Function VersionerVersionConfig.versionPattern is not accessible from the versioner module
Function VersionerVersionConfig.versionPattern is not accessible from the versioner module
validateCommits() 🔗
Whether to validate commit messages (default: true)
Return Type
Boolean !
Example
Function VersionerVersionConfig.validateCommits is not accessible from the versioner module
Function VersionerVersionConfig.validateCommits is not accessible from the versioner module
Function VersionerVersionConfig.validateCommits is not accessible from the versioner module
Function VersionerVersionConfig.validateCommits is not accessible from the versioner module
generateChangelog() 🔗
Whether to auto-generate changelog (default: true)
Return Type
Boolean !
Example
Function VersionerVersionConfig.generateChangelog is not accessible from the versioner module
Function VersionerVersionConfig.generateChangelog is not accessible from the versioner module
Function VersionerVersionConfig.generateChangelog is not accessible from the versioner module
Function VersionerVersionConfig.generateChangelog is not accessible from the versioner module
createTags() 🔗
Whether to create git tags (default: true)
Return Type
Boolean !
Example
Function VersionerVersionConfig.createTags is not accessible from the versioner module
Function VersionerVersionConfig.createTags is not accessible from the versioner module
Function VersionerVersionConfig.createTags is not accessible from the versioner module
Function VersionerVersionConfig.createTags is not accessible from the versioner module
branchConfig() 🔗
Branch configuration
Return Type
BranchConfig !
Example
Function VersionerVersionConfig.branchConfig is not accessible from the versioner module
Function VersionerVersionConfig.branchConfig is not accessible from the versioner module
Function VersionerVersionConfig.branchConfig is not accessible from the versioner module
Function VersionerVersionConfig.branchConfig is not accessible from the versioner module
commitConfig() 🔗
Commit message configuration
Return Type
CommitConfig !
Example
Function VersionerVersionConfig.commitConfig is not accessible from the versioner module
Function VersionerVersionConfig.commitConfig is not accessible from the versioner module
Function VersionerVersionConfig.commitConfig is not accessible from the versioner module
Function VersionerVersionConfig.commitConfig is not accessible from the versioner module
BranchConfig 🔗
BranchConfig holds branch-specific configuration
mainBranch() 🔗
Main branch name (default: “main”)
Return Type
String !
Example
Function VersionerBranchConfig.mainBranch is not accessible from the versioner module
Function VersionerBranchConfig.mainBranch is not accessible from the versioner module
Function VersionerBranchConfig.mainBranch is not accessible from the versioner module
Function VersionerBranchConfig.mainBranch is not accessible from the versioner module
developBranch() 🔗
Development branch name (default: “develop”)
Return Type
String !
Example
Function VersionerBranchConfig.developBranch is not accessible from the versioner module
Function VersionerBranchConfig.developBranch is not accessible from the versioner module
Function VersionerBranchConfig.developBranch is not accessible from the versioner module
Function VersionerBranchConfig.developBranch is not accessible from the versioner module
releaseBranchPrefix() 🔗
Release branch prefix (default: “release/”)
Return Type
String !
Example
Function VersionerBranchConfig.releaseBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.releaseBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.releaseBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.releaseBranchPrefix is not accessible from the versioner module
hotfixBranchPrefix() 🔗
Hotfix branch prefix (default: “hotfix/”)
Return Type
String !
Example
Function VersionerBranchConfig.hotfixBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.hotfixBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.hotfixBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.hotfixBranchPrefix is not accessible from the versioner module
featureBranchPrefix() 🔗
Feature branch prefix (default: “feature/”)
Return Type
String !
Example
Function VersionerBranchConfig.featureBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.featureBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.featureBranchPrefix is not accessible from the versioner module
Function VersionerBranchConfig.featureBranchPrefix is not accessible from the versioner module
CommitConfig 🔗
CommitConfig holds commit message configuration
types() 🔗
Types of changes that trigger version increments
Return Type
[CommitType ! ] !
Example
Function VersionerCommitConfig.types is not accessible from the versioner module
Function VersionerCommitConfig.types is not accessible from the versioner module
Function VersionerCommitConfig.types is not accessible from the versioner module
Function VersionerCommitConfig.types is not accessible from the versioner module
scopes() 🔗
Scopes allowed in commit messages
Return Type
[String ! ] !
Example
Function VersionerCommitConfig.scopes is not accessible from the versioner module
Function VersionerCommitConfig.scopes is not accessible from the versioner module
Function VersionerCommitConfig.scopes is not accessible from the versioner module
Function VersionerCommitConfig.scopes is not accessible from the versioner module
requireScope() 🔗
Whether to require scope (default: false)
Return Type
Boolean !
Example
Function VersionerCommitConfig.requireScope is not accessible from the versioner module
Function VersionerCommitConfig.requireScope is not accessible from the versioner module
Function VersionerCommitConfig.requireScope is not accessible from the versioner module
Function VersionerCommitConfig.requireScope is not accessible from the versioner module
allowCustomScopes() 🔗
Whether to allow custom scopes (default: true)
Return Type
Boolean !
Example
Function VersionerCommitConfig.allowCustomScopes is not accessible from the versioner module
Function VersionerCommitConfig.allowCustomScopes is not accessible from the versioner module
Function VersionerCommitConfig.allowCustomScopes is not accessible from the versioner module
Function VersionerCommitConfig.allowCustomScopes is not accessible from the versioner module
breakingChangeIndicators() 🔗
Breaking change indicators
Return Type
[String ! ] !
Example
Function VersionerCommitConfig.breakingChangeIndicators is not accessible from the versioner module
Function VersionerCommitConfig.breakingChangeIndicators is not accessible from the versioner module
Function VersionerCommitConfig.breakingChangeIndicators is not accessible from the versioner module
Function VersionerCommitConfig.breakingChangeIndicators is not accessible from the versioner module
CommitType 🔗
CommitType represents a type of commit and its version increment
type() 🔗
Type of commit (e.g., “feat”, “fix”)
Return Type
String !
Example
Function VersionerCommitType.type is not accessible from the versioner module
Function VersionerCommitType.type is not accessible from the versioner module
Function VersionerCommitType.type is not accessible from the versioner module
Function VersionerCommitType.type is not accessible from the versioner module
increment() 🔗
Version increment for this type
Return Type
Enum !
Example
Function VersionerCommitType.increment is not accessible from the versioner module
Function VersionerCommitType.increment is not accessible from the versioner module
Function VersionerCommitType.increment is not accessible from the versioner module
Function VersionerCommitType.increment is not accessible from the versioner module