From 1b35e8a1fcd47e46cb20c0ef53b4c12e8f3a36e7 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Mon, 8 Aug 2016 14:46:55 -0500 Subject: [PATCH] add octopus command for push --- src/app/FakeLib/OctoTools.fs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/FakeLib/OctoTools.fs b/src/app/FakeLib/OctoTools.fs index db6914f2a8e..15a17e48ccd 100644 --- a/src/app/FakeLib/OctoTools.fs +++ b/src/app/FakeLib/OctoTools.fs @@ -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 = { @@ -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 @@ -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)" }