Move environment variable definitions to an internal lib

This commit is contained in:
Don 2019-10-10 12:59:12 -07:00
parent 6b33d765ac
commit 99e18f9a03
3 changed files with 62 additions and 242 deletions

View File

@ -3,14 +3,7 @@
// Use of this source code is governed by an Apache 2.0 license that can be // Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file. // found in the LICENSE file.
package plugin package environ
import (
"os"
"strconv"
"strings"
"time"
)
// List of enviornment variables set by Drone when running a step within a // List of enviornment variables set by Drone when running a step within a
// build stage. // build stage.
@ -173,84 +166,3 @@ const (
// SemVerVersionEnvVar corresponds to SemVer.Version // SemVerVersionEnvVar corresponds to SemVer.Version
SemVerVersionEnvVar = "DRONE_SEMVER" SemVerVersionEnvVar = "DRONE_SEMVER"
) )
// StringEnvVar gets the environment variable's value.
//
// If the value is not present then this returns the empty string.
func StringEnvVar(envVar string) string {
return envVarValue(envVar)
}
// StringSliceEnvVar gets the environment variable as a string slice.
//
// If the value is not present then this returns an empty slice.
func StringSliceEnvVar(envVar string) []string {
return strings.Split(envVarValue(envVar), ",")
}
// IntEnvVar gets the environment variable as an int.
//
// If the value is not present then this returns 0.
func IntEnvVar(envVar string) int {
return int(Int64EnvVar(envVar))
}
// Int64EnvVar gets the environment variable as an int64.
//
// If the value is not present then this returns 0.
func Int64EnvVar(envVar string) int64 {
value, err := strconv.ParseInt(envVarValue(envVar), 0, 64)
if err != nil {
return 0
}
return value
}
// UintEnvVar gets the environment variable as an uint.
//
// If the value is not present then this returns 0.
func UintEnvVar(envVar string) uint {
return uint(Uint64EnvVar(envVar))
}
// Uint64EnvVar gets the environment variable as an uint64.
//
// If the value is not present then this returns 0.
func Uint64EnvVar(envVar string) uint64 {
value, err := strconv.ParseUint(envVarValue(envVar), 0, 64)
if err != nil {
return 0
}
return value
}
// BoolEnvVar gets the environment variable as a bool.
//
// If the value is not present then this returns false.
func BoolEnvVar(envVar string) bool {
value, err := strconv.ParseBool(envVarValue(envVar))
if err != nil {
return false
}
return value
}
// TimeEnvVar gets the environment variable as a Time created from a unix
// timestamp.
//
// If the value is not present then this returns time.Unix(0).
func TimeEnvVar(envVar string) time.Time {
return time.Unix(Int64EnvVar(envVar), 0)
}
// envVarValue returns the first matched environment variable or the empty
// string if none was found.
func envVarValue(envVar string) string {
return os.Getenv(envVar)
}

View File

@ -157,97 +157,3 @@ type (
Version string Version string
} }
) )
// BuildFromEnv creates a Build from the environment variables used by Drone.
func BuildFromEnv() Build {
return Build{
Action: StringEnvVar(BuildActionEnvVar),
Created: TimeEnvVar(BuildCreatedEnvVar),
DeployTo: StringEnvVar(BuildDeployToEnvVar),
Event: StringEnvVar(BuildEventEnvVar),
FailedStages: StringSliceEnvVar(BuildFailedStagesEnvVar),
FailedSteps: StringSliceEnvVar(BuildFailedStepsEnvVar),
Finished: TimeEnvVar(BuildFinishedEnvVar),
Number: IntEnvVar(BuildNumberEnvVar),
Parent: IntEnvVar(BuildParentEnvVar),
PullRequest: IntEnvVar(BuildPullRequestEnvVar),
SourceBranch: StringEnvVar(BuildSourceBranchEnvVar),
Started: TimeEnvVar(BuildStartedEnvVar),
Status: StringEnvVar(BuildStatusEnvVar),
Tag: StringEnvVar(BuildTagEnvVar),
TargetBranch: StringEnvVar(BuildTargetBranchEnvVar),
}
}
// RepoFromEnv creates a Repo from the environment variables used by Drone.
func RepoFromEnv() Repo {
return Repo{
DefaultBranch: StringEnvVar(RepoDefaultBranchEnvVar),
FullName: StringEnvVar(RepoFullNameEnvVar),
Link: StringEnvVar(RepoLinkEnvVar),
Name: StringEnvVar(RepoNameEnvVar),
Owner: StringEnvVar(RepoOwnerEnvVar),
Private: BoolEnvVar(RepoPrivateEnvVar),
RemoteURL: StringEnvVar(RepoRemoteURLEnvVar),
SCM: StringEnvVar(RepoSCMEnvVar),
Visibility: StringEnvVar(RepoVisibilityEnvVar),
}
}
// CommitFromEnv creates a Commit from the environment variables used by Drone.
func CommitFromEnv() Commit {
return Commit{
After: StringEnvVar(CommitAfterEnvVar),
Author: StringEnvVar(CommitAuthorEnvVar),
AuthorAvatar: StringEnvVar(CommitAuthorAvatarEnvVar),
AuthorEmail: StringEnvVar(CommitAuthorEmailEnvVar),
AuthorName: StringEnvVar(CommitAuthorNameEnvVar),
Before: StringEnvVar(CommitBeforeEnvVar),
Branch: StringEnvVar(CommitBranchEnvVar),
Link: StringEnvVar(CommitLinkEnvVar),
Message: StringEnvVar(CommitMessageEnvVar),
Ref: StringEnvVar(CommitRefEnvVar),
SHA: StringEnvVar(CommitSHAEnvVar),
}
}
// StageFromEnv creates a Stage from the environment variables used by Drone.
func StageFromEnv() Stage {
return Stage{
Arch: StringEnvVar(StageArchEnvVar),
DependsOn: StringSliceEnvVar(StageDependsOnEnvVar),
Finished: TimeEnvVar(StageFinishedEnvVar),
Kind: StringEnvVar(StageKindEnvVar),
Machine: StringEnvVar(StageMachineEnvVar),
Name: StringEnvVar(StageNameEnvVar),
Number: IntEnvVar(StageNumberEnvVar),
OS: StringEnvVar(StageOSEnvVar),
Started: TimeEnvVar(StageStartedEnvVar),
Status: StringEnvVar(StageStatusEnvVar),
Type: StringEnvVar(StageTypeEnvVar),
Variant: StringEnvVar(StageVariantEnvVar),
Version: StringEnvVar(StageVersionEnvVar),
}
}
// StepFromEnv creates a Step from the environment variables used by Drone.
func StepFromEnv() Step {
return Step{
Name: StringEnvVar(StepNameEnvVar),
Number: IntEnvVar(StepNumberEnvVar),
}
}
// SemVerFromEnv creates a SemVer from the environment variables used by Drone.
func SemVerFromEnv() SemVer {
return SemVer{
Build: StringEnvVar(SemVerBuildEnvVar),
Error: StringEnvVar(SemVerErrorEnvVar),
Major: StringEnvVar(SemVerMajorEnvVar),
Minor: StringEnvVar(SemVerMinorEnvVar),
Patch: StringEnvVar(SemVerPatchEnvVar),
Prerelease: StringEnvVar(SemVerPrereleaseEnvVar),
Short: StringEnvVar(SemVerShortEnvVar),
Version: StringEnvVar(SemVerVersionEnvVar),
}
}

View File

@ -32,8 +32,10 @@ package urfave
import ( import (
"time" "time"
"github.com/drone-plugins/drone-plugin-lib/pkg/plugin"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/drone-plugins/drone-plugin-lib/internal/environ"
"github.com/drone-plugins/drone-plugin-lib/pkg/plugin"
) )
//--------------------------------------------------------------------- //---------------------------------------------------------------------
@ -79,91 +81,91 @@ func BuildFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: BuildActionFlag, Name: BuildActionFlag,
Usage: "build action", Usage: "build action",
EnvVar: plugin.BuildActionEnvVar, EnvVar: environ.BuildActionEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildCreatedFlag, Name: BuildCreatedFlag,
Usage: "build created", Usage: "build created",
EnvVar: plugin.BuildCreatedEnvVar, EnvVar: environ.BuildCreatedEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildDeployToFlag, Name: BuildDeployToFlag,
Usage: "build deploy to", Usage: "build deploy to",
EnvVar: plugin.BuildDeployToEnvVar, EnvVar: environ.BuildDeployToEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildEventFlag, Name: BuildEventFlag,
Usage: "build event", Usage: "build event",
EnvVar: plugin.BuildEventEnvVar, EnvVar: environ.BuildEventEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringSliceFlag{ cli.StringSliceFlag{
Name: BuildFailedStagesFlag, Name: BuildFailedStagesFlag,
Usage: "build failed stages", Usage: "build failed stages",
EnvVar: plugin.BuildFailedStagesEnvVar, EnvVar: environ.BuildFailedStagesEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringSliceFlag{ cli.StringSliceFlag{
Name: BuildFailedStepsFlag, Name: BuildFailedStepsFlag,
Usage: "build failed steps", Usage: "build failed steps",
EnvVar: plugin.BuildFailedStepsEnvVar, EnvVar: environ.BuildFailedStepsEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildFinishedFlag, Name: BuildFinishedFlag,
Usage: "build finished", Usage: "build finished",
EnvVar: plugin.BuildFinishedEnvVar, EnvVar: environ.BuildFinishedEnvVar,
Hidden: true, Hidden: true,
}, },
cli.IntFlag{ cli.IntFlag{
Name: BuildNumberFlag, Name: BuildNumberFlag,
Usage: "build number", Usage: "build number",
EnvVar: plugin.BuildNumberEnvVar, EnvVar: environ.BuildNumberEnvVar,
Hidden: true, Hidden: true,
}, },
cli.IntFlag{ cli.IntFlag{
Name: BuildParentFlag, Name: BuildParentFlag,
Usage: "build parent", Usage: "build parent",
EnvVar: plugin.BuildParentEnvVar, EnvVar: environ.BuildParentEnvVar,
Hidden: true, Hidden: true,
}, },
cli.IntFlag{ cli.IntFlag{
Name: BuildPullRequestFlag, Name: BuildPullRequestFlag,
Usage: "build pull request", Usage: "build pull request",
EnvVar: plugin.BuildPullRequestEnvVar, EnvVar: environ.BuildPullRequestEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildSourceBranchFlag, Name: BuildSourceBranchFlag,
Usage: "build source branch", Usage: "build source branch",
EnvVar: plugin.BuildSourceBranchEnvVar, EnvVar: environ.BuildSourceBranchEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildStartedFlag, Name: BuildStartedFlag,
Usage: "build started", Usage: "build started",
EnvVar: plugin.BuildStartedEnvVar, EnvVar: environ.BuildStartedEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildStatusFlag, Name: BuildStatusFlag,
Usage: "build status", Usage: "build status",
EnvVar: plugin.BuildStatusEnvVar, EnvVar: environ.BuildStatusEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildTagFlag, Name: BuildTagFlag,
Usage: "build tag", Usage: "build tag",
EnvVar: plugin.BuildTagEnvVar, EnvVar: environ.BuildTagEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: BuildTargetBranchFlag, Name: BuildTargetBranchFlag,
Usage: "build target branch", Usage: "build target branch",
EnvVar: plugin.BuildTargetBranchEnvVar, EnvVar: environ.BuildTargetBranchEnvVar,
Hidden: true, Hidden: true,
}, },
} }
@ -221,55 +223,55 @@ func RepoFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: RepoDefaultBranchFlag, Name: RepoDefaultBranchFlag,
Usage: "repo default branch", Usage: "repo default branch",
EnvVar: plugin.RepoDefaultBranchEnvVar, EnvVar: environ.RepoDefaultBranchEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoFullNameFlag, Name: RepoFullNameFlag,
Usage: "repo full name", Usage: "repo full name",
EnvVar: plugin.RepoFullNameEnvVar, EnvVar: environ.RepoFullNameEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoLinkFlag, Name: RepoLinkFlag,
Usage: "repo link", Usage: "repo link",
EnvVar: plugin.RepoLinkEnvVar, EnvVar: environ.RepoLinkEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoNameFlag, Name: RepoNameFlag,
Usage: "repo name", Usage: "repo name",
EnvVar: plugin.RepoNameEnvVar, EnvVar: environ.RepoNameEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoOwnerFlag, Name: RepoOwnerFlag,
Usage: "repo owner", Usage: "repo owner",
EnvVar: plugin.RepoOwnerEnvVar, EnvVar: environ.RepoOwnerEnvVar,
Hidden: true, Hidden: true,
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: RepoPrivateFlag, Name: RepoPrivateFlag,
Usage: "repo private", Usage: "repo private",
EnvVar: plugin.RepoPrivateEnvVar, EnvVar: environ.RepoPrivateEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoRemoteURLFlag, Name: RepoRemoteURLFlag,
Usage: "repo remote url", Usage: "repo remote url",
EnvVar: plugin.RepoRemoteURLEnvVar, EnvVar: environ.RepoRemoteURLEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoSCMFlag, Name: RepoSCMFlag,
Usage: "repo scm", Usage: "repo scm",
EnvVar: plugin.RepoSCMEnvVar, EnvVar: environ.RepoSCMEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: RepoVisibilityFlag, Name: RepoVisibilityFlag,
Usage: "repo visibility", Usage: "repo visibility",
EnvVar: plugin.RepoVisibilityEnvVar, EnvVar: environ.RepoVisibilityEnvVar,
Hidden: true, Hidden: true,
}, },
} }
@ -325,67 +327,67 @@ func CommitFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: CommitAfterFlag, Name: CommitAfterFlag,
Usage: "commit after", Usage: "commit after",
EnvVar: plugin.CommitAfterEnvVar, EnvVar: environ.CommitAfterEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitAuthorFlag, Name: CommitAuthorFlag,
Usage: "commit author", Usage: "commit author",
EnvVar: plugin.CommitAuthorEnvVar, EnvVar: environ.CommitAuthorEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitAuthorAvatarFlag, Name: CommitAuthorAvatarFlag,
Usage: "commit author avatar", Usage: "commit author avatar",
EnvVar: plugin.CommitAuthorAvatarEnvVar, EnvVar: environ.CommitAuthorAvatarEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitAuthorEmailFlag, Name: CommitAuthorEmailFlag,
Usage: "commit author email", Usage: "commit author email",
EnvVar: plugin.CommitAuthorEmailEnvVar, EnvVar: environ.CommitAuthorEmailEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitAuthorNameFlag, Name: CommitAuthorNameFlag,
Usage: "commit author name", Usage: "commit author name",
EnvVar: plugin.CommitAuthorNameEnvVar, EnvVar: environ.CommitAuthorNameEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitBeforeFlag, Name: CommitBeforeFlag,
Usage: "commit before", Usage: "commit before",
EnvVar: plugin.CommitBeforeEnvVar, EnvVar: environ.CommitBeforeEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitBranchFlag, Name: CommitBranchFlag,
Usage: "commit branch", Usage: "commit branch",
EnvVar: plugin.CommitBranchEnvVar, EnvVar: environ.CommitBranchEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitLinkFlag, Name: CommitLinkFlag,
Usage: "commit link", Usage: "commit link",
EnvVar: plugin.CommitLinkEnvVar, EnvVar: environ.CommitLinkEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitMessageFlag, Name: CommitMessageFlag,
Usage: "commit message", Usage: "commit message",
EnvVar: plugin.CommitMessageEnvVar, EnvVar: environ.CommitMessageEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitRefFlag, Name: CommitRefFlag,
Usage: "commit ref", Usage: "commit ref",
EnvVar: plugin.CommitRefEnvVar, EnvVar: environ.CommitRefEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: CommitSHAFlag, Name: CommitSHAFlag,
Usage: "commit sha", Usage: "commit sha",
EnvVar: plugin.CommitSHAEnvVar, EnvVar: environ.CommitSHAEnvVar,
Hidden: true, Hidden: true,
}, },
} }
@ -447,69 +449,69 @@ func StageFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: StageArchFlag, Name: StageArchFlag,
Usage: "stage arch", Usage: "stage arch",
EnvVar: plugin.StageArchEnvVar, EnvVar: environ.StageArchEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringSliceFlag{ cli.StringSliceFlag{
Name: StageDependsOnFlag, Name: StageDependsOnFlag,
Usage: "stage depends on", Usage: "stage depends on",
EnvVar: plugin.StageDependsOnEnvVar, EnvVar: environ.StageDependsOnEnvVar,
Hidden: true, Hidden: true,
}, },
cli.Int64Flag{ cli.Int64Flag{
Name: StageFinishedFlag, Name: StageFinishedFlag,
Usage: "stage finished", Usage: "stage finished",
EnvVar: plugin.StageFinishedEnvVar, EnvVar: environ.StageFinishedEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageKindFlag, Name: StageKindFlag,
Usage: "stage kind", Usage: "stage kind",
EnvVar: plugin.StageKindEnvVar, EnvVar: environ.StageKindEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageMachineFlag, Name: StageMachineFlag,
Usage: "stage machine", Usage: "stage machine",
EnvVar: plugin.StageMachineEnvVar, EnvVar: environ.StageMachineEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageNameFlag, Name: StageNameFlag,
Usage: "stage name", Usage: "stage name",
EnvVar: plugin.StageNameEnvVar, EnvVar: environ.StageNameEnvVar,
Hidden: true, Hidden: true,
}, cli.IntFlag{ }, cli.IntFlag{
Name: StageNumberFlag, Name: StageNumberFlag,
Usage: "stage number", Usage: "stage number",
EnvVar: plugin.StageNumberEnvVar, EnvVar: environ.StageNumberEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageOSFlag, Name: StageOSFlag,
Usage: "stage os", Usage: "stage os",
EnvVar: plugin.StageOSEnvVar, EnvVar: environ.StageOSEnvVar,
Hidden: true, Hidden: true,
}, cli.Int64Flag{ }, cli.Int64Flag{
Name: StageStartedFlag, Name: StageStartedFlag,
Usage: "stage started", Usage: "stage started",
EnvVar: plugin.StageStartedEnvVar, EnvVar: environ.StageStartedEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageStatusFlag, Name: StageStatusFlag,
Usage: "stage status", Usage: "stage status",
EnvVar: plugin.StageStatusEnvVar, EnvVar: environ.StageStatusEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageTypeFlag, Name: StageTypeFlag,
Usage: "stage type", Usage: "stage type",
EnvVar: plugin.StageTypeEnvVar, EnvVar: environ.StageTypeEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageVariantFlag, Name: StageVariantFlag,
Usage: "stage variant", Usage: "stage variant",
EnvVar: plugin.StageVariantEnvVar, EnvVar: environ.StageVariantEnvVar,
Hidden: true, Hidden: true,
}, cli.StringFlag{ }, cli.StringFlag{
Name: StageVersionFlag, Name: StageVersionFlag,
Usage: "stage version", Usage: "stage version",
EnvVar: plugin.StageVersionEnvVar, EnvVar: environ.StageVersionEnvVar,
Hidden: true, Hidden: true,
}, },
} }
@ -551,13 +553,13 @@ func StepFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: StepNameFlag, Name: StepNameFlag,
Usage: "step name", Usage: "step name",
EnvVar: plugin.StepNameEnvVar, EnvVar: environ.StepNameEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: StepNumberFlag, Name: StepNumberFlag,
Usage: "step number", Usage: "step number",
EnvVar: plugin.StepNumberEnvVar, EnvVar: environ.StepNumberEnvVar,
Hidden: true, Hidden: true,
}, },
} }
@ -600,49 +602,49 @@ func SemVerFlags() []cli.Flag {
cli.StringFlag{ cli.StringFlag{
Name: SemVerBuildFlag, Name: SemVerBuildFlag,
Usage: "semver build", Usage: "semver build",
EnvVar: plugin.SemVerBuildEnvVar, EnvVar: environ.SemVerBuildEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerErrorFlag, Name: SemVerErrorFlag,
Usage: "semver error", Usage: "semver error",
EnvVar: plugin.SemVerErrorEnvVar, EnvVar: environ.SemVerErrorEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerMajorFlag, Name: SemVerMajorFlag,
Usage: "semver major", Usage: "semver major",
EnvVar: plugin.SemVerMajorEnvVar, EnvVar: environ.SemVerMajorEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerMinorFlag, Name: SemVerMinorFlag,
Usage: "semver minor", Usage: "semver minor",
EnvVar: plugin.SemVerMinorEnvVar, EnvVar: environ.SemVerMinorEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerPatchFlag, Name: SemVerPatchFlag,
Usage: "semver patch", Usage: "semver patch",
EnvVar: plugin.SemVerPatchEnvVar, EnvVar: environ.SemVerPatchEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerPrereleaseFlag, Name: SemVerPrereleaseFlag,
Usage: "semver prerelease", Usage: "semver prerelease",
EnvVar: plugin.SemVerPrereleaseEnvVar, EnvVar: environ.SemVerPrereleaseEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerShortFlag, Name: SemVerShortFlag,
Usage: "semver short", Usage: "semver short",
EnvVar: plugin.SemVerShortEnvVar, EnvVar: environ.SemVerShortEnvVar,
Hidden: true, Hidden: true,
}, },
cli.StringFlag{ cli.StringFlag{
Name: SemVerVersionFlag, Name: SemVerVersionFlag,
Usage: "semver version", Usage: "semver version",
EnvVar: plugin.SemVerVersionEnvVar, EnvVar: environ.SemVerVersionEnvVar,
Hidden: true, Hidden: true,
}, },
} }