{"modulePath":"github.com/OctopusDeploy/cli","version":"v1.7.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package executor\n\n## Constants\n\n```go\nconst (\n\tTaskTypeCreateAccount = TaskType(\"CreateAccount\")\n\tTaskTypeCreateRelease = TaskType(\"CreateRelease\")\n\tTaskTypeDeployRelease = TaskType(\"DeployRelease\")\n\tTaskTypeRunbookRun    = TaskType(\"RunbookRun\")\n)\n```\n\n```go\nconst AccountTypeToken = \"Token\"\n```\n\n```go\nconst AccountTypeUsernamePassword = \"Username/Password\"\n```\naccount type values match the UI\n\n## Functions\n\n```go\nfunc ProcessTasks(octopus *client.Client, space *spaces.Space, tasks []*Task) error\n```\nProcessTasks iterates over the list of tasks and attempts to run them all. If everything goes well, a nil error will be returned. On the first failure, the error will be returned and the process will halt. TODO some kind of progress/results callback? A Goroutine with channels?\n\n## Types\n\n```go\ntype Task struct {\n\t// which type of task this is.\n\tType TaskType\n\n\t// task-specific payload (usually a struct containing the data required for this task)\n\t// rememmber pass this as a pointer\n\tOptions any\n}\n```\n\n```go\nfunc NewTask(taskType TaskType, options any) *Task\n```\n\n```go\ntype TaskOptionsCreateAccount struct {\n\tType           string   // REQUIRED. refer to AccountType constant strings\n\tName           string   // REQUIRED.\n\tDescription    string   // optional\n\tEnvironmentIds []string // optional. // TODO the user may have specified environment string names; the outer code should resolve them before building the TaskInput\n\tOptions        any      // subtype-specific payload\n}\n```\n\n```go\ntype TaskOptionsCreateAccountToken struct {\n\tToken *core.SensitiveValue\n}\n```\n\n```go\ntype TaskOptionsCreateAccountUsernamePassword struct {\n\tUsername string\n\tPassword *core.SensitiveValue\n}\n```\n\n```go\ntype TaskOptionsCreateRelease struct {\n\tProjectName             string   // Required\n\tDefaultPackageVersion   string   // Optional\n\tGitCommit               string   // Optional\n\tGitReference            string   // Required for version controlled projects\n\tVersion                 string   // optional\n\tChannelName             string   // optional\n\tReleaseNotes            string   // optional\n\tIgnoreIfAlreadyExists   bool     // optional\n\tIgnoreChannelRules      bool     // optional\n\tPackageVersionOverrides []string // optional\n\t// if the task succeeds, the resulting output will be stored here\n\tResponse *releases.CreateReleaseResponseV1\n}\n```\n\n```go\ntype TaskOptionsDeployRelease struct {\n\tProjectName          string   // required\n\tReleaseVersion       string   // the release to deploy\n\tEnvironments         []string // multiple for untenanted deployment, only one entry for tenanted deployment\n\tTenants              []string\n\tTenantTags           []string\n\tScheduledStartTime   string\n\tScheduledExpiryTime  string\n\tExcludedSteps        []string\n\tGuidedFailureMode    string // [\"\", \"true\", \"false\", \"default\"]. Note default and \"\" are the same, the only difference is whether interactive mode prompts you\n\tForcePackageDownload bool\n\tDeploymentTargets    []string\n\tExcludeTargets       []string\n\tVariables            map[string]string\n\tUpdateVariables      bool\n\n\t// true if the value was specified on the command line (because ForcePackageDownload is bool, we can't distinguish 'false' from 'missing')\n\tForcePackageDownloadWasSpecified bool\n\n\t// so the automation command can mask sensitive variable output\n\tSensitiveVariableNames []string\n\n\t// printing a link to the release (to check deployment status) requires the release ID, not version.\n\t// the interactive process looks this up, so we can cache it here to avoid a second lookup when generating\n\t// the link for the browser. It isn't neccessary though\n\tReleaseID string\n\n\t// After we send the request to the server, the response is stored here\n\tResponse *deployments.CreateDeploymentResponseV1\n}\n```\n\n```go\ntype TaskOptionsRunbookRun struct {\n\tProjectName          string // required\n\tRunbookName          string // the name of the runbook to run\n\tEnvironments         []string\n\tTenants              []string\n\tTenantTags           []string\n\tScheduledStartTime   string\n\tScheduledExpiryTime  string\n\tExcludedSteps        []string\n\tGuidedFailureMode    string // [\"\", \"true\", \"false\", \"default\"]. Note default and \"\" are the same, the only difference is whether interactive mode prompts you\n\tForcePackageDownload bool\n\tRunTargets           []string\n\tExcludeTargets       []string\n\tVariables            map[string]string\n\tSnapshot             string\n\n\t// true if the value was specified on the command line (because ForcePackageDownload is bool, we can't distinguish 'false' from 'missing')\n\tForcePackageDownloadWasSpecified bool\n\n\t// so the automation command can mask sensitive variable output\n\tSensitiveVariableNames []string\n\n\t// if the task succeeds, the resulting output will be stored here\n\tResponse *runbooks.RunbookRunResponseV1\n}\n```\n\n```go\ntype TaskResultCreateRelease struct {\n\tVersion string\n}\n```\n\n```go\ntype TaskResultRunbookRun struct {\n\tVersion string\n}\n```\n\n```go\ntype TaskType string\n```\ntask type definitions\n\n","path":"github.com/OctopusDeploy/cli/pkg/executor","name":"executor","synopsis":"","isRedistributable":true}
