Documentation ¶
Index ¶
- Constants
- func AskPackageOverrideLoop(packageVersionBaseline []*StepPackageVersion, defaultPackageVersion string, ...) ([]*StepPackageVersion, []*PackageVersionOverride, error)
- func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker question.Asker, ...) error
- func NewCmdCreate(f factory.Factory) *cobra.Command
- type AmbiguousPackageVersionOverride
- type CreateFlags
- type PackageVersionOverride
- type StepPackageVersion
Constants ¶
const ( FlagProject = "project" FlagChannel = "channel" FlagPackageVersionSpec = "package" FlagVersion = "version" FlagAliasReleaseNumberLegacy = "releaseNumber" // alias for FlagVersion FlagPackageVersion = "package-version" FlagAliasDefaultPackageVersion = "default-package-version" // alias for FlagPackageVersion FlagAliasPackageVersionLegacy = "packageVersion" // alias for FlagPackageVersion FlagAliasDefaultPackageVersionLegacy = "defaultPackageVersion" // alias for FlagPackageVersion FlagReleaseNotes = "release-notes" FlagAliasReleaseNotesLegacy = "releaseNotes" FlagReleaseNotesFile = "release-notes-file" FlagAliasReleaseNotesFileLegacy = "releaseNotesFile" FlagAliasReleaseNoteFileLegacy = "releaseNoteFile" FlagGitRef = "git-ref" FlagAliasGitRefLegacy = "gitRef" FlagAliasGitRefRef = "ref" // alias for FlagGitRef FlagGitCommit = "git-commit" FlagAliasGitCommitLegacy = "gitCommit" FlagIgnoreExisting = "ignore-existing" FlagAliasIgnoreExistingLegacy = "ignoreExisting" FlagIgnoreChannelRules = "ignore-channel-rules" FlagAliasIgnoreChannelRulesLegacy = "ignoreChannelRules" )
Variables ¶
This section is empty.
Functions ¶
func AskPackageOverrideLoop ¶
func AskPackageOverrideLoop( packageVersionBaseline []*StepPackageVersion, defaultPackageVersion string, initialPackageOverrideFlags []string, asker question.Asker, stdout io.Writer) ([]*StepPackageVersion, []*PackageVersionOverride, error)
func AskQuestions ¶
func AskQuestions(octopus *octopusApiClient.Client, stdout io.Writer, asker question.Asker, options *executor.TaskOptionsCreateRelease) error
Types ¶
type AmbiguousPackageVersionOverride ¶
type AmbiguousPackageVersionOverride struct { ActionNameOrPackageID string PackageReferenceName string Version string }
AmbiguousPackageVersionOverride tells us that we want to set the version of some package to `Version` but it's not clear whether ActionNameOrPackageID refers to an ActionName or PackageID at this point
func ParsePackageOverrideString ¶
func ParsePackageOverrideString(packageOverride string) (*AmbiguousPackageVersionOverride, error)
ParsePackageOverrideString parses a package version override string into a structure. Logic should align with PackageVersionResolver in the Octopus Server and .NET CLI In cases where things are ambiguous, we look in steps for matching values to see if something is a PackageID or a StepName
type CreateFlags ¶
type CreateFlags struct { Project *flag.Flag[string] Channel *flag.Flag[string] GitRef *flag.Flag[string] GitCommit *flag.Flag[string] PackageVersion *flag.Flag[string] ReleaseNotes *flag.Flag[string] ReleaseNotesFile *flag.Flag[string] Version *flag.Flag[string] IgnoreExisting *flag.Flag[bool] IgnoreChannelRules *flag.Flag[bool] PackageVersionSpec *flag.Flag[[]string] }
func NewCreateFlags ¶
func NewCreateFlags() *CreateFlags
type PackageVersionOverride ¶
type PackageVersionOverride struct { ActionName string // optional, but one or both of ActionName or PackageID must be supplied PackageID string // optional, but one or both of ActionName or PackageID must be supplied PackageReferenceName string // optional; use for advanced situations where the same package is referenced multiple times by a single step Version string // required }
func ResolvePackageOverride ¶
func ResolvePackageOverride(override *AmbiguousPackageVersionOverride, steps []*StepPackageVersion) (*PackageVersionOverride, error)
func (*PackageVersionOverride) ToPackageOverrideString ¶
func (p *PackageVersionOverride) ToPackageOverrideString() string
ToPackageOverrideString converts the struct back into a string which the server can parse e.g. StepName:Version. This is the inverse of ParsePackageOverrideString
type StepPackageVersion ¶
type StepPackageVersion struct { // these 3 fields are the main ones for showing the user PackageID string ActionName string // "StepName is an obsolete alias for ActionName, they always contain the same value" Version string // note this may be an empty string, indicating that no version could be found for this package yet // used to locate the deployment process VersioningStrategy Donor Package PackageReferenceName string }
func ApplyPackageOverrides ¶
func ApplyPackageOverrides(packages []*StepPackageVersion, overrides []*PackageVersionOverride) []*StepPackageVersion
func BuildPackageVersionBaseline ¶
func BuildPackageVersionBaseline(octopus *octopusApiClient.Client, deploymentProcessTemplate *deployments.DeploymentProcessTemplate, channel *channels.Channel) ([]*StepPackageVersion, error)
BuildPackageVersionBaseline loads the deployment process template from the server, and for each step+package therein, finds the latest available version satisfying the channel version rules. Result is the list of step+package+versions to use as a baseline. The package version override process takes this as an input and layers on top of it