Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add octopus command for push #1349

Merged
merged 1 commit into from
Aug 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/app/FakeLib/OctoTools.fs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,20 @@ type DeleteReleaseOptions = {
/// Maximum (inclusive) version number for the range of versions to delete
MaxVersion : string }

type PushOptions = {
// paths to one or more packages to push to the server
Packages : string list
/// if the package already exists, should this package overwrite it?
ReplaceExisting : bool
}

/// Option type for selecting one command
type OctoCommand =
| CreateRelease of CreateReleaseOptions * DeployReleaseOptions option
| DeployRelease of DeployReleaseOptions
| DeleteRelease of DeleteReleaseOptions
| ListEnvironments
| Push of PushOptions

/// Complete Octo.exe CLI params
type OctoParams = {
Expand Down Expand Up @@ -203,6 +211,12 @@ let serverCommandLine (opts:OctoServerOptions) =
(optionalStringParam "apikey" (liftString opts.ApiKey)) ]
|> List.fold (+) ""

/// [omit]
let pushCommandLine (opts : PushOptions) =
[ stringListParam "package" opts.Packages
flag "replace-existing" opts.ReplaceExisting ]
|> List.fold (+) ""

/// Maps a command to string input for the octopus tools cli.
let commandLine command =
match command with
Expand All @@ -216,6 +230,8 @@ let commandLine command =
sprintf " delete-releases%s" (deleteCommandLine opts)
| ListEnvironments ->
" list-environments"
| Push opts ->
sprintf " push%s" (pushCommandLine opts)

let serverCommandLineForTracing (opts: OctoServerOptions) = serverCommandLine { opts with ApiKey = "(Removed for security purposes)" }

Expand Down