From 77700f466935724d1841ec50779e9205855f6302 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Sat, 13 Jan 2018 10:03:04 -0600 Subject: [PATCH 1/6] Add support for Kudu Zip Deploy --- src/legacy/FakeLib/AzureKudu.fs | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/legacy/FakeLib/AzureKudu.fs b/src/legacy/FakeLib/AzureKudu.fs index 46120da60b0..620115d97c4 100644 --- a/src/legacy/FakeLib/AzureKudu.fs +++ b/src/legacy/FakeLib/AzureKudu.fs @@ -56,3 +56,43 @@ let kuduSync() = (TimeSpan.FromMinutes 5.) output |> Seq.iter (fun cm -> printfn "%O: %s" cm.Timestamp cm.Message) if not succeeded then failwith "Error occurred during Kudu Sync deployment." + +/// Kudu ZipDeploy parameters +type ZipDeployParams = + { /// The url of the website, usually in the format of https://.scm.azurewebsites.net + Url : Uri + /// The WebDeploy or Git username, usually the $username from the site's publish profile + UserName : string + /// The WebDeploy or Git Password + Password : string + /// The path to the zip archive to upload + PackageLocation: string } + +/// Synchronizes contents of the zip package with the target web app using Kudu ZipDeploy. +/// See https://blogs.msdn.microsoft.com/appserviceteam/2017/10/16/zip-push-deployment-for-web-apps-functions-and-webjobs/ +let zipDeploy { Url = uri; UserName = username; Password = password; PackageLocation = zipFile } = + // Create the web request. + let request = + Net.HttpWebRequest.Create(uri.AbsoluteUri + "api/zipdeploy", + Method = "POST", + ContentType = "multipart/form-data", + Timeout = 300000) :?> Net.HttpWebRequest + + // Set the authorization header. + let authToken = + Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(sprintf "%s:%s" username password)) + request.Headers.Add("Authorization", sprintf "Basic %s" authToken) + + // Write the zip file to the request stream, then flush and close it to send. + do use fileStream = new FileStream(zipFile, FileMode.Open) + use inFile = request.GetRequestStream() + fileStream.CopyTo(inFile) + inFile.Flush() + inFile.Close() + + // Get the response. If 200 OK, then the deploy succeeded. Otherwise, the deploy failed. + use response = request.GetResponse() :?> Net.HttpWebResponse + if response.StatusCode = Net.HttpStatusCode.OK then + logfn "Deployed %s" uri.AbsoluteUri + else + failwithf "Failed to deploy package with status code %A" response.StatusCode From 01c4bb70914959713c166eb3e8a238275c083c00 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Mon, 5 Mar 2018 14:42:35 -0800 Subject: [PATCH 2/6] Add FAKE 5 Azure modules --- Fake.sln | 130 +++++++++++++----- build.fsx | 4 + .../Fake.Azure.CloudServices/AssemblyInfo.fs | 17 +++ .../Fake.Azure.CloudServices/CloudServices.fs | 95 +++++++++++++ .../Fake.Azure.CloudServices.fsproj | 26 ++++ .../Fake.Azure.CloudServices/paket.references | 12 ++ src/app/Fake.Azure.Emulators/AssemblyInfo.fs | 17 +++ src/app/Fake.Azure.Emulators/Emulators.fs | 85 ++++++++++++ .../Fake.Azure.Emulators.fsproj | 26 ++++ src/app/Fake.Azure.Emulators/paket.references | 7 + src/app/Fake.Azure.Kudu/AssemblyInfo.fs | 17 +++ .../Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj | 26 ++++ src/app/Fake.Azure.Kudu/Kudu.fs | 102 ++++++++++++++ src/app/Fake.Azure.Kudu/paket.references | 7 + src/app/Fake.Azure.WebJobs/AssemblyInfo.fs | 17 +++ .../Fake.Azure.WebJobs.fsproj | 24 ++++ src/app/Fake.Azure.WebJobs/WebJobs.fs | 93 +++++++++++++ src/app/Fake.Azure.WebJobs/paket.references | 8 ++ src/legacy/FakeLib/AzureKudu.fs | 2 +- 19 files changed, 679 insertions(+), 36 deletions(-) create mode 100644 src/app/Fake.Azure.CloudServices/AssemblyInfo.fs create mode 100644 src/app/Fake.Azure.CloudServices/CloudServices.fs create mode 100644 src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj create mode 100644 src/app/Fake.Azure.CloudServices/paket.references create mode 100644 src/app/Fake.Azure.Emulators/AssemblyInfo.fs create mode 100644 src/app/Fake.Azure.Emulators/Emulators.fs create mode 100644 src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj create mode 100644 src/app/Fake.Azure.Emulators/paket.references create mode 100644 src/app/Fake.Azure.Kudu/AssemblyInfo.fs create mode 100644 src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj create mode 100644 src/app/Fake.Azure.Kudu/Kudu.fs create mode 100644 src/app/Fake.Azure.Kudu/paket.references create mode 100644 src/app/Fake.Azure.WebJobs/AssemblyInfo.fs create mode 100644 src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj create mode 100644 src/app/Fake.Azure.WebJobs/WebJobs.fs create mode 100644 src/app/Fake.Azure.WebJobs/paket.references diff --git a/Fake.sln b/Fake.sln index 6aa47b67fd6..af05b8d3441 100644 --- a/Fake.sln +++ b/Fake.sln @@ -4,77 +4,85 @@ VisualStudioVersion = 15.0.27130.2026 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{7BFFAE76-DEE9-417A-A79B-6A6644C4553A}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Context", "src/app/Fake.Core.Context/Fake.Core.Context.fsproj", "{D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Context", "src\app\Fake.Core.Context\Fake.Core.Context.fsproj", "{D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Environment", "src/app/Fake.Core.Environment/Fake.Core.Environment.fsproj", "{A2C4A85F-24C4-4FFA-B165-4807B1127C4E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Environment", "src\app\Fake.Core.Environment\Fake.Core.Environment.fsproj", "{A2C4A85F-24C4-4FFA-B165-4807B1127C4E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Process", "src/app/Fake.Core.Process/Fake.Core.Process.fsproj", "{DB09FF66-8750-40B8-9E25-70FADD9CF0BD}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Process", "src\app\Fake.Core.Process\Fake.Core.Process.fsproj", "{DB09FF66-8750-40B8-9E25-70FADD9CF0BD}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.ReleaseNotes", "src/app/Fake.Core.ReleaseNotes/Fake.Core.ReleaseNotes.fsproj", "{FEDE1F15-C0A5-4DA1-B20D-0A0C28F6858E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.ReleaseNotes", "src\app\Fake.Core.ReleaseNotes\Fake.Core.ReleaseNotes.fsproj", "{FEDE1F15-C0A5-4DA1-B20D-0A0C28F6858E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.SemVer", "src/app/Fake.Core.SemVer/Fake.Core.SemVer.fsproj", "{AFCCC2AB-EFFE-4CAE-ACAD-3434B04D3A4E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.SemVer", "src\app\Fake.Core.SemVer\Fake.Core.SemVer.fsproj", "{AFCCC2AB-EFFE-4CAE-ACAD-3434B04D3A4E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.String", "src/app/Fake.Core.String/Fake.Core.String.fsproj", "{D5B2FEB2-BA3A-492D-B83D-414835043D86}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.String", "src\app\Fake.Core.String\Fake.Core.String.fsproj", "{D5B2FEB2-BA3A-492D-B83D-414835043D86}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Trace", "src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj", "{9430365D-C956-4290-A006-A87F9083DC4B}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Trace", "src\app\Fake.Core.Trace\Fake.Core.Trace.fsproj", "{9430365D-C956-4290-A006-A87F9083DC4B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Target", "src/app/Fake.Core.Target/Fake.Core.Target.fsproj", "{0C28F2FB-2B12-4893-AAA4-2C2548926847}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Target", "src\app\Fake.Core.Target\Fake.Core.Target.fsproj", "{0C28F2FB-2B12-4893-AAA4-2C2548926847}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Tasks", "src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj", "{83860B89-4A95-49A5-B4D6-B8F3345498E9}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Tasks", "src\app\Fake.Core.Tasks\Fake.Core.Tasks.fsproj", "{83860B89-4A95-49A5-B4D6-B8F3345498E9}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Xml", "src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj", "{C3C12DCE-7AC4-4E97-A7FC-49189D218885}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Xml", "src\app\Fake.Core.Xml\Fake.Core.Xml.fsproj", "{C3C12DCE-7AC4-4E97-A7FC-49189D218885}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.AssemblyInfoFile", "src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj", "{BB293F2E-C3BD-4F1C-8345-8AEF01998D2C}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.AssemblyInfoFile", "src\app\Fake.DotNet.AssemblyInfoFile\Fake.DotNet.AssemblyInfoFile.fsproj", "{BB293F2E-C3BD-4F1C-8345-8AEF01998D2C}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Cli", "src/app/Fake.DotNet.Cli/Fake.DotNet.Cli.fsproj", "{B2C0063A-FC66-4883-BB69-B1DBE6BF9CA2}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Cli", "src\app\Fake.DotNet.Cli\Fake.DotNet.Cli.fsproj", "{B2C0063A-FC66-4883-BB69-B1DBE6BF9CA2}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MsBuild", "src/app/Fake.DotNet.MsBuild/Fake.DotNet.MsBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MsBuild", "src\app\Fake.DotNet.MsBuild\Fake.DotNet.MsBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.NuGet", "src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj", "{93F1A71E-54E2-4C65-BB1E-1D499890317F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.NuGet", "src\app\Fake.DotNet.NuGet\Fake.DotNet.NuGet.fsproj", "{93F1A71E-54E2-4C65-BB1E-1D499890317F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSpec", "src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj", "{C1B87E1F-8D0D-4A78-9A24-9D5D38B7E9A8}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSpec", "src\app\Fake.DotNet.Testing.MSpec\Fake.DotNet.Testing.MSpec.fsproj", "{C1B87E1F-8D0D-4A78-9A24-9D5D38B7E9A8}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.NUnit", "src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj", "{75C9DD21-B4EA-4117-BF4F-AFE777A80B5B}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.NUnit", "src\app\Fake.DotNet.Testing.NUnit\Fake.DotNet.Testing.NUnit.fsproj", "{75C9DD21-B4EA-4117-BF4F-AFE777A80B5B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.XUnit2", "src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F39}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.XUnit2", "src\app\Fake.DotNet.Testing.XUnit2\Fake.DotNet.Testing.XUnit2.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F39}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSTest", "src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F30}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSTest", "src\app\Fake.DotNet.Testing.MSTest\Fake.DotNet.Testing.MSTest.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F30}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.FileSystem", "src/app/Fake.IO.FileSystem/Fake.IO.FileSystem.fsproj", "{4B1416CD-C7CB-4670-8EFE-871ED316D51D}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.FileSystem", "src\app\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj", "{4B1416CD-C7CB-4670-8EFE-871ED316D51D}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.Zip", "src/app/Fake.IO.Zip/Fake.IO.Zip.fsproj", "{46ED6A9C-C5BF-4495-924E-478736FC280E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.Zip", "src\app\Fake.IO.Zip\Fake.IO.Zip.fsproj", "{46ED6A9C-C5BF-4495-924E-478736FC280E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Runtime", "src/app/Fake.Runtime/Fake.Runtime.fsproj", "{44A3F022-D70A-422D-B850-824BB572F2AF}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Runtime", "src\app\Fake.Runtime\Fake.Runtime.fsproj", "{44A3F022-D70A-422D-B850-824BB572F2AF}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.Common", "src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj", "{7D629246-957C-4989-A1E6-29C673086925}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.Common", "src\app\Fake.Testing.Common\Fake.Testing.Common.fsproj", "{7D629246-957C-4989-A1E6-29C673086925}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Windows.Chocolatey", "src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj", "{A95B731B-5887-4EF5-A64D-B643FA8EBD92}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Windows.Chocolatey", "src\app\Fake.Windows.Chocolatey\Fake.Windows.Chocolatey.fsproj", "{A95B731B-5887-4EF5-A64D-B643FA8EBD92}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Git", "src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj", "{E32B2631-476A-4C2D-AE18-275ED7A22F10}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Git", "src\app\Fake.Tools.Git\Fake.Tools.Git.fsproj", "{E32B2631-476A-4C2D-AE18-275ED7A22F10}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.FSFormatting", "src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj", "{80314941-78D5-4928-B943-93FC945E050F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.FSFormatting", "src\app\Fake.DotNet.FSFormatting\Fake.DotNet.FSFormatting.fsproj", "{80314941-78D5-4928-B943-93FC945E050F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Paket", "src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj", "{CDFB2B10-050A-4188-8F72-2BCC61E9814F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Paket", "src\app\Fake.DotNet.Paket\Fake.DotNet.Paket.fsproj", "{CDFB2B10-050A-4188-8F72-2BCC61E9814F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.netcore", "src/app/Fake.netcore/Fake.netcore.fsproj", "{6B339DA3-8DED-4262-A427-3C4CCDD00650}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.netcore", "src\app\Fake.netcore\Fake.netcore.fsproj", "{6B339DA3-8DED-4262-A427-3C4CCDD00650}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.SonarQube", "src/app/Fake.Testing.SonarQube/Fake.Testing.SonarQube.fsproj", "{2A985028-4410-40F7-992C-5397DC1ED116}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.SonarQube", "src\app\Fake.Testing.SonarQube\Fake.Testing.SonarQube.fsproj", "{2A985028-4410-40F7-992C-5397DC1ED116}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.OpenCover", "src/app/Fake.DotNet.Testing.OpenCover/Fake.DotNet.Testing.OpenCover.fsproj", "{A9AF015B-43C9-405E-BF74-CE936B8418F9}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.OpenCover", "src\app\Fake.DotNet.Testing.OpenCover\Fake.DotNet.Testing.OpenCover.fsproj", "{A9AF015B-43C9-405E-BF74-CE936B8418F9}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.Slack", "src/app/Fake.Api.Slack/Fake.Api.Slack.fsproj", "{58A3EDF0-CA9D-4757-B1E8-2A4E3592B308}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.Slack", "src\app\Fake.Api.Slack\Fake.Api.Slack.fsproj", "{58A3EDF0-CA9D-4757-B1E8-2A4E3592B308}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.GitHub", "src/app/Fake.Api.GitHub/Fake.Api.GitHub.fsproj", "{4BCE4F9C-8FC2-4207-81F1-20CB07D852DC}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.GitHub", "src\app\Fake.Api.GitHub\Fake.Api.GitHub.fsproj", "{4BCE4F9C-8FC2-4207-81F1-20CB07D852DC}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Xamarin", "src/app/Fake.DotNet.Xamarin/Fake.DotNet.Xamarin.fsproj", "{13C1F95D-2FAD-4890-BF94-0AE7CF9AB2FC}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Xamarin", "src\app\Fake.DotNet.Xamarin\Fake.DotNet.Xamarin.fsproj", "{13C1F95D-2FAD-4890-BF94-0AE7CF9AB2FC}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Net.Http", "src/app/Fake.Net.Http/Fake.Net.Http.fsproj", "{D24CEE35-B6C0-4C92-AE18-E80F90B69974}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Net.Http", "src\app\Fake.Net.Http\Fake.Net.Http.fsproj", "{D24CEE35-B6C0-4C92-AE18-E80F90B69974}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "dotnet-fake", "src/app/dotnet-fake/dotnet-fake.fsproj", "{DB27F0BB-D546-42B2-85DA-52870B4424FD}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "dotnet-fake", "src\app\dotnet-fake\dotnet-fake.fsproj", "{DB27F0BB-D546-42B2-85DA-52870B4424FD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCAC5CAB-03C8-4C11-ADBE-A0D05F6A4F18}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.UnitTests", "src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj", "{31A5759B-B562-43C0-A845-14EFA4091543}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.UnitTests", "src\test\Fake.Core.UnitTests\Fake.Core.UnitTests.fsproj", "{31A5759B-B562-43C0-A845-14EFA4091543}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.CloudServices", "src\app\Fake.Azure.CloudServices\Fake.Azure.CloudServices.fsproj", "{D8850C67-0542-427A-ABCB-92174EA42C95}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Emulators", "src\app\Fake.Azure.Emulators\Fake.Azure.Emulators.fsproj", "{8D72BED1-BC02-4B23-A631-4849BD0FD3E1}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Kudu", "src\app\Fake.Azure.Kudu\Fake.Azure.Kudu.fsproj", "{A1CAA84D-3C99-4218-AFB6-55EE2288800E}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.WebJobs", "src\app\Fake.Azure.WebJobs\Fake.Azure.WebJobs.fsproj", "{F15967FF-E905-4CAD-9545-E59E0F47AD8E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -506,6 +514,54 @@ Global {31A5759B-B562-43C0-A845-14EFA4091543}.Release|x64.Build.0 = Release|Any CPU {31A5759B-B562-43C0-A845-14EFA4091543}.Release|x86.ActiveCfg = Release|Any CPU {31A5759B-B562-43C0-A845-14EFA4091543}.Release|x86.Build.0 = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|x64.ActiveCfg = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|x64.Build.0 = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|x86.ActiveCfg = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Debug|x86.Build.0 = Debug|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|Any CPU.Build.0 = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|x64.ActiveCfg = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|x64.Build.0 = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|x86.ActiveCfg = Release|Any CPU + {D8850C67-0542-427A-ABCB-92174EA42C95}.Release|x86.Build.0 = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|x64.Build.0 = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Debug|x86.Build.0 = Debug|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|Any CPU.Build.0 = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|x64.ActiveCfg = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|x64.Build.0 = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|x86.ActiveCfg = Release|Any CPU + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1}.Release|x86.Build.0 = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|x64.ActiveCfg = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|x64.Build.0 = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|x86.ActiveCfg = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Debug|x86.Build.0 = Debug|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|Any CPU.Build.0 = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|x64.ActiveCfg = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|x64.Build.0 = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|x86.ActiveCfg = Release|Any CPU + {A1CAA84D-3C99-4218-AFB6-55EE2288800E}.Release|x86.Build.0 = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|x64.ActiveCfg = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|x64.Build.0 = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|x86.ActiveCfg = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Debug|x86.Build.0 = Debug|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|Any CPU.Build.0 = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|x64.ActiveCfg = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|x64.Build.0 = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|x86.ActiveCfg = Release|Any CPU + {F15967FF-E905-4CAD-9545-E59E0F47AD8E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -546,6 +602,10 @@ Global {D24CEE35-B6C0-4C92-AE18-E80F90B69974} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {DB27F0BB-D546-42B2-85DA-52870B4424FD} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} {31A5759B-B562-43C0-A845-14EFA4091543} = {CCAC5CAB-03C8-4C11-ADBE-A0D05F6A4F18} + {D8850C67-0542-427A-ABCB-92174EA42C95} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} + {8D72BED1-BC02-4B23-A631-4849BD0FD3E1} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} + {A1CAA84D-3C99-4218-AFB6-55EE2288800E} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} + {F15967FF-E905-4CAD-9545-E59E0F47AD8E} = {7BFFAE76-DEE9-417A-A79B-6A6644C4553A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {058A0C5E-2216-4306-8AFB-0AE28320C26A} diff --git a/build.fsx b/build.fsx index 5cc3ef887e6..0419df23d2e 100644 --- a/build.fsx +++ b/build.fsx @@ -220,6 +220,10 @@ let dotnetAssemblyInfos = [ "dotnet-fake", "Fake dotnet-cli command line tool" "Fake.Api.Slack", "Slack Integration Support" "Fake.Api.GitHub", "GitHub Client API Support via Octokit" + "Fake.Azure.CloudServices", "FAKE - F# Make Azure Cloud Services Support" + "Fake.Azure.Emulators", "FAKE - F# Make Azure Emulators Support" + "Fake.Azure.Kudu", "FAKE - F# Make Azure Kudu Support" + "Fake.Azure.WebJobs", "FAKE - F# Make Azure Web Jobs Support" "Fake.Core.Context", "Core Context Infrastructure" "Fake.Core.Environment", "Environment Detection" "Fake.Core.Process", "Starting and managing Processes" diff --git a/src/app/Fake.Azure.CloudServices/AssemblyInfo.fs b/src/app/Fake.Azure.CloudServices/AssemblyInfo.fs new file mode 100644 index 00000000000..b0d6f10078b --- /dev/null +++ b/src/app/Fake.Azure.CloudServices/AssemblyInfo.fs @@ -0,0 +1,17 @@ +// Auto-Generated by FAKE; do not edit +namespace System +open System.Reflection + +[] +[] +[] +[] +[] +do () + +module internal AssemblyVersionInformation = + let [] AssemblyTitle = "FAKE - F# Make Azure Cloud Services Support" + let [] AssemblyProduct = "FAKE - F# Make" + let [] AssemblyVersion = "5.0.0" + let [] AssemblyInformationalVersion = "5.0.0" + let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Azure.CloudServices/CloudServices.fs b/src/app/Fake.Azure.CloudServices/CloudServices.fs new file mode 100644 index 00000000000..f694cb0ee7a --- /dev/null +++ b/src/app/Fake.Azure.CloudServices/CloudServices.fs @@ -0,0 +1,95 @@ +/// Contains tasks to package Azure Cloud Services. +module Fake.Azure.CloudServices + +open System.IO +open Fake.Core +open Fake.IO +open Fake.IO.Globbing.Operators + +/// Configuration details for packaging cloud services. +[] +type PackageCloudServiceParams = + { /// The name of the Cloud Service. + CloudService : string + /// The name of the role in the service. + WorkerRole : string + /// The SDK version to use e.g. 2.2. If None, the latest available version is used. + SdkVersion : float option + /// The output path for the .cspkg. + OutputPath : string option } + +let DefaultCloudServiceParams = { CloudService = ""; WorkerRole = ""; SdkVersion = None; OutputPath = None } + +module VmSizes = + type VmSize = | VmSize of size:string + let ExtraSmall = VmSize "ExtraSmall" + let Small = VmSize "Small" + let Medium = VmSize "Medium" + let Large = VmSize "Large" + let ExtraLarge = VmSize "ExtraLarge" + let A5 = VmSize "A5" + let A6 = VmSize "A6" + let A7 = VmSize "A7" + let A8 = VmSize "A8" + let A9 = VmSize "A9" + +/// Modifies the size of the Worker Role in the csdef. +let ModifyVMSize (VmSizes.VmSize vmSize) cloudService = + let csdefPath = sprintf @"%s\ServiceDefinition.csdef" cloudService + csdefPath + |> File.ReadAllText + |> Xml.Doc + |> Xml.XPathReplaceNS + "/svchost:ServiceDefinition/svchost:WorkerRole/@vmsize" + vmSize + [ "svchost", "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" ] + |> fun doc -> doc.Save csdefPath + +/// Packages a cloud service role into a .cspkg, ready for deployment. +let PackageRole packageCloudServiceParams = + let csPack = + let sdkRoots = + [ @"C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\" + @"C:\Program Files\Microsoft SDKs\Azure\.NET SDK\" ] + + let availableCsPacks = + sdkRoots + |> Seq.collect(fun sdkRoot -> + !! (sdkRoot + @"**\cspack.exe") + |> Seq.filter(fun path -> path.Substring(sdkRoot.Length).StartsWith "v") + |> Seq.map(fun path -> sdkRoot, path)) + |> Seq.map(fun (sdkRoot, cspackPath) -> + let version = + cspackPath.Substring(sdkRoot.Length).Split '\\' + |> Seq.head + |> fun version -> version.Substring 1 + |> float + version, sdkRoot, cspackPath) + |> Seq.cache + + match packageCloudServiceParams.SdkVersion with + | Some version -> + availableCsPacks + |> Seq.tryFind(fun (csPackVersion,_,_) -> csPackVersion = version) + |> Option.map(fun (_,_,csPackFileInfo) -> csPackFileInfo) + | None -> + availableCsPacks + |> Seq.sortBy(fun (v,_,_) -> -v) + |> Seq.map(fun (_,_,csPackFileInfo) -> csPackFileInfo) + |> Seq.tryFind(fun _ -> true) + + csPack + |> Option.map(fun csPack -> + packageCloudServiceParams.OutputPath |> Option.iter(DirectoryInfo.ensure << DirectoryInfo.ofPath) + let outputFileArg = + packageCloudServiceParams.OutputPath + |> Option.map(fun path -> Path.Combine(path, (packageCloudServiceParams.CloudService + ".cspkg"))) + |> Option.map(sprintf "/out:%s") + |> defaultArg + <| "" + + Process.shellExec + { ExecParams.Empty with + Program = csPack + CommandLine = sprintf @"%s\ServiceDefinition.csdef /role:%s;%s\bin\release;%s.dll %s" packageCloudServiceParams.CloudService packageCloudServiceParams.WorkerRole packageCloudServiceParams.WorkerRole packageCloudServiceParams.WorkerRole outputFileArg + Args = [] }) diff --git a/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj b/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj new file mode 100644 index 00000000000..a1dacb00ecc --- /dev/null +++ b/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj @@ -0,0 +1,26 @@ + + + net46;netstandard1.6;netstandard2.0 + Fake.Azure.CloudServices + Library + + + $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + + + $(DefineConstants);RELEASE + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/Fake.Azure.CloudServices/paket.references b/src/app/Fake.Azure.CloudServices/paket.references new file mode 100644 index 00000000000..88a62a0db97 --- /dev/null +++ b/src/app/Fake.Azure.CloudServices/paket.references @@ -0,0 +1,12 @@ +group netcore + +FSharp.Core +NETStandard.Library +System.Diagnostics.FileVersionInfo +System.Diagnostics.Process +System.IO.FileSystem.Watcher +System.Xml.XDocument +System.Xml.XPath +System.Xml.XPath.XDocument +System.Xml.XPath.XmlDocument +System.Xml.ReaderWriter \ No newline at end of file diff --git a/src/app/Fake.Azure.Emulators/AssemblyInfo.fs b/src/app/Fake.Azure.Emulators/AssemblyInfo.fs new file mode 100644 index 00000000000..dd6ce7a5a29 --- /dev/null +++ b/src/app/Fake.Azure.Emulators/AssemblyInfo.fs @@ -0,0 +1,17 @@ +// Auto-Generated by FAKE; do not edit +namespace System +open System.Reflection + +[] +[] +[] +[] +[] +do () + +module internal AssemblyVersionInformation = + let [] AssemblyTitle = "FAKE - F# Make Azure Emulators Support" + let [] AssemblyProduct = "FAKE - F# Make" + let [] AssemblyVersion = "5.0.0" + let [] AssemblyInformationalVersion = "5.0.0" + let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Azure.Emulators/Emulators.fs b/src/app/Fake.Azure.Emulators/Emulators.fs new file mode 100644 index 00000000000..49b2c8abcd8 --- /dev/null +++ b/src/app/Fake.Azure.Emulators/Emulators.fs @@ -0,0 +1,85 @@ +/// Contains tasks to control the local Azure Emulator +module Fake.Azure.Emulators + +open System +open Fake.Core +open Fake.IO +open Fake.IO.FileSystemOperators + +/// A type for the controlling parameter +[] +type private AzureEmulatorParams = { + StorageEmulatorToolPath:Lazy + CSRunToolPath:string + TimeOut:TimeSpan + } + +/// Base path for getting tools from Microsoft SDKs +let msSdkBasePath = Environment.ProgramFilesX86 @@ "Microsoft SDKs" + +/// The default parameters for Azure emulators +let private AzureEmulatorDefaults = { + StorageEmulatorToolPath = + lazy + let path = msSdkBasePath @@ @"\Azure\Storage Emulator\AzureStorageEmulator.exe" + if File.exists path then path + else failwith (sprintf "Unable to locate Azure Storage Emulator at %s" path) + CSRunToolPath = "\"C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\csrun.exe\"" + TimeOut = TimeSpan.FromMinutes 5. + } + +let private (|StorageAlreadyStarted|StorageAlreadyStopped|Ok|OtherError|) = function + | 0 -> Ok + | -5 -> StorageAlreadyStarted + | -6 -> StorageAlreadyStopped + | _ -> OtherError + +/// Stops the storage emulator +let StopStorageEmulator = (fun _ -> + match Process.Exec (fun info -> + { info with + FileName = AzureEmulatorDefaults.StorageEmulatorToolPath.Value + Arguments = "stop" }) AzureEmulatorDefaults.TimeOut with + | Ok | StorageAlreadyStopped -> () + | _ -> failwithf "Azure Emulator Failure on stop Storage Emulator" +) + +/// Starts the storage emulator +let StartStorageEmulator = (fun _ -> + match Process.Exec (fun info -> + { info with + FileName = AzureEmulatorDefaults.StorageEmulatorToolPath.Value + Arguments = "start" }) AzureEmulatorDefaults.TimeOut with + | Ok | StorageAlreadyStarted -> () + | _ -> failwithf "Azure Emulator Failure on start Storage Emulator" +) + +/// Stops the compute emulator +let StopComputeEmulator = (fun _ -> + if 0 <> Process.Exec (fun info -> + { info with + FileName = AzureEmulatorDefaults.CSRunToolPath + Arguments = "/devfabric:shutdown" }) AzureEmulatorDefaults.TimeOut + then + failwithf "Azure Emulator Failure on stop Fabric Emulator" +) + +/// Starts the compute emulator +let StartComputeEmulator = (fun _ -> + if 0 <> Process.Exec (fun info -> + { info with + FileName = AzureEmulatorDefaults.CSRunToolPath + Arguments = "/devfabric:start" }) AzureEmulatorDefaults.TimeOut + then + failwithf "Azure Emulator Failure on start Fabric Emulator" +) + +/// Resets the devstore (BLOB, Queues and Tables) +let ResetDevStorage = (fun _ -> + if 0 <> Process.Exec (fun info -> + { info with + FileName = AzureEmulatorDefaults.StorageEmulatorToolPath.Value + Arguments = "clear all" }) AzureEmulatorDefaults.TimeOut + then + failwithf "Azure Emulator Failure on reset Dev Storage" +) diff --git a/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj b/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj new file mode 100644 index 00000000000..f64c7851127 --- /dev/null +++ b/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj @@ -0,0 +1,26 @@ + + + net46;netstandard1.6;netstandard2.0 + Fake.Azure.Emulators + Library + + + $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + + + $(DefineConstants);RELEASE + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/Fake.Azure.Emulators/paket.references b/src/app/Fake.Azure.Emulators/paket.references new file mode 100644 index 00000000000..b888890f25f --- /dev/null +++ b/src/app/Fake.Azure.Emulators/paket.references @@ -0,0 +1,7 @@ +group netcore + +FSharp.Core +NETStandard.Library +System.Diagnostics.FileVersionInfo +System.Diagnostics.Process +System.IO.FileSystem.Watcher \ No newline at end of file diff --git a/src/app/Fake.Azure.Kudu/AssemblyInfo.fs b/src/app/Fake.Azure.Kudu/AssemblyInfo.fs new file mode 100644 index 00000000000..90091e8f2b4 --- /dev/null +++ b/src/app/Fake.Azure.Kudu/AssemblyInfo.fs @@ -0,0 +1,17 @@ +// Auto-Generated by FAKE; do not edit +namespace System +open System.Reflection + +[] +[] +[] +[] +[] +do () + +module internal AssemblyVersionInformation = + let [] AssemblyTitle = "FAKE - F# Make Azure Kudu Support" + let [] AssemblyProduct = "FAKE - F# Make" + let [] AssemblyVersion = "5.0.0" + let [] AssemblyInformationalVersion = "5.0.0" + let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj b/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj new file mode 100644 index 00000000000..9c7ce3d1740 --- /dev/null +++ b/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj @@ -0,0 +1,26 @@ + + + net46;netstandard1.6;netstandard2.0 + Fake.Azure.Kudu + Library + + + $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + + + $(DefineConstants);RELEASE + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/Fake.Azure.Kudu/Kudu.fs b/src/app/Fake.Azure.Kudu/Kudu.fs new file mode 100644 index 00000000000..57e089e58ff --- /dev/null +++ b/src/app/Fake.Azure.Kudu/Kudu.fs @@ -0,0 +1,102 @@ +/// Contains tasks to stage and deploy Azure website and webjobs using source code deployment with Kudu Sync. +module Fake.Azure.Kudu + +open System +open System.IO +open Fake.Core +open Fake.Core.Environment +open Fake.Core.Trace +open Fake.IO + +/// Location where staged outputs should go before synced up to the site. +let deploymentTemp = environVarOrDefault "DEPLOYMENT_TEMP" (Path.GetTempPath() + "kudutemp") +/// Location where synced outputs should be deployed to. +let deploymentTarget = environVarOrDefault "DEPLOYMENT_TARGET" (Path.GetTempPath() + "kudutarget") +/// Used by KuduSync for tracking and diffing deployments. +let nextManifestPath = environVarOrDefault "NEXT_MANIFEST_PATH" String.Empty +/// Used by KuduSync for tracking and diffing deployments. +let previousManifestPath = environVarOrDefault "PREVIOUS_MANIFEST_PATH" String.Empty +/// The path to the KuduSync application. +let kuduPath = (environVarOrDefault "GO_WEB_CONFIG_TEMPLATE" ".") |> DirectoryInfo.ofPath + +/// The different types of web jobs. +type WebJobType = Scheduled | Continuous + +// Some initial cleanup / prep +do + Directory.CreateDirectory deploymentTemp |> ignore + Directory.CreateDirectory deploymentTarget |> ignore + Shell.CleanDir deploymentTemp + +/// +/// Stages a folder and all subdirectories into the temp deployment area, ready for deployment into the website. +/// +/// The source folder to copy. +/// A predicate which includes files from the folder. If the entire directory should be copied, this predicate should always return true. +let stageFolder source shouldInclude = + Shell.CopyRecursive source deploymentTemp true + |> Seq.filter (not << shouldInclude) + |> Seq.iter File.Delete + +/// Gets the path for deploying a web job to. +let getWebJobPath webJobType webJobName = + let webJobType = match webJobType with Scheduled -> "triggered" | Continuous -> "continuous" + sprintf @"%s\app_data\jobs\%s\%s\" deploymentTemp webJobType webJobName + +/// Stages a set of files into a WebJob folder in the temp deployment area, ready for deployment into the website as a webjob. +let stageWebJob webJobType webJobName files = + let webJobPath = getWebJobPath webJobType webJobName + Directory.CreateDirectory webJobPath |> ignore + files |> Shell.CopyFiles webJobPath + +/// Synchronises all staged files from the temporary deployment to the actual deployment, removing +/// any obsolete files, updating changed files and adding new files. +let kuduSync() = + let succeeded, output = + Process.ExecRedirected(fun psi -> + { psi with + FileName = Path.Combine(kuduPath.FullName, "kudusync.cmd") + Arguments = sprintf """-v 50 -f "%s" -t "%s" -n "%s" -p "%s" -i ".git;.hg;.deployment;deploy.cmd""" deploymentTemp deploymentTarget nextManifestPath previousManifestPath }) + (TimeSpan.FromMinutes 5.) + output |> Seq.iter (fun cm -> printfn "%O: %s" cm.Timestamp cm.Message) + if not succeeded then failwith "Error occurred during Kudu Sync deployment." + +/// Kudu ZipDeploy parameters +type ZipDeployParams = + { /// The url of the website, usually in the format of https://.scm.azurewebsites.net + Url : Uri + /// The WebDeploy or Git username, usually the $username from the site's publish profile + UserName : string + /// The WebDeploy or Git Password + Password : string + /// The path to the zip archive to upload + PackageLocation: string } + +/// Synchronizes contents of the zip package with the target web app using Kudu ZipDeploy. +/// See https://blogs.msdn.microsoft.com/appserviceteam/2017/10/16/zip-push-deployment-for-web-apps-functions-and-webjobs/ +let zipDeploy { Url = uri; UserName = username; Password = password; PackageLocation = zipFile } = + // Create the web request. + let request = + Net.HttpWebRequest.Create(uri.AbsoluteUri + "api/zipdeploy", + Method = "POST", + ContentType = "multipart/form-data", + Timeout = 300000) :?> Net.HttpWebRequest + + // Set the authorization header. + let authToken = + Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(sprintf "%s:%s" username password)) + request.Headers.Add("Authorization", sprintf "Basic %s" authToken) + + // Write the zip file to the request stream, then flush and close it to send. + do use fileStream = new FileStream(zipFile, FileMode.Open) + use inFile = request.GetRequestStream() + fileStream.CopyTo(inFile) + inFile.Flush() + inFile.Close() + + // Get the response. If 200 OK, then the deploy succeeded. Otherwise, the deploy failed. + use response = request.GetResponse() :?> Net.HttpWebResponse + if response.StatusCode = Net.HttpStatusCode.OK then + tracefn "Deployed %s" uri.AbsoluteUri + else + failwithf "Failed to deploy package with status code %A" response.StatusCode diff --git a/src/app/Fake.Azure.Kudu/paket.references b/src/app/Fake.Azure.Kudu/paket.references new file mode 100644 index 00000000000..4a7b7c4619b --- /dev/null +++ b/src/app/Fake.Azure.Kudu/paket.references @@ -0,0 +1,7 @@ +group netcore + +FSharp.Core +NETStandard.Library +System.Diagnostics.FileVersionInfo +System.Diagnostics.Process +System.IO.FileSystem.Watcher diff --git a/src/app/Fake.Azure.WebJobs/AssemblyInfo.fs b/src/app/Fake.Azure.WebJobs/AssemblyInfo.fs new file mode 100644 index 00000000000..787b94f5571 --- /dev/null +++ b/src/app/Fake.Azure.WebJobs/AssemblyInfo.fs @@ -0,0 +1,17 @@ +// Auto-Generated by FAKE; do not edit +namespace System +open System.Reflection + +[] +[] +[] +[] +[] +do () + +module internal AssemblyVersionInformation = + let [] AssemblyTitle = "FAKE - F# Make Azure Web Jobs Support" + let [] AssemblyProduct = "FAKE - F# Make" + let [] AssemblyVersion = "5.0.0" + let [] AssemblyInformationalVersion = "5.0.0" + let [] AssemblyFileVersion = "5.0.0" diff --git a/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj b/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj new file mode 100644 index 00000000000..ec9aca66dd2 --- /dev/null +++ b/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj @@ -0,0 +1,24 @@ + + + net46;netstandard1.6;netstandard2.0 + Fake.Azure.WebJobs + Library + + + $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + + + $(DefineConstants);RELEASE + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/app/Fake.Azure.WebJobs/WebJobs.fs b/src/app/Fake.Azure.WebJobs/WebJobs.fs new file mode 100644 index 00000000000..d2b19acbe00 --- /dev/null +++ b/src/app/Fake.Azure.WebJobs/WebJobs.fs @@ -0,0 +1,93 @@ +/// Contains tasks to package and deploy [Azure Web Jobs](http://azure.microsoft.com/en-gb/documentation/articles/web-sites-create-web-jobs/) via the [Kudu](https://github.com/projectkudu/kudu) Zip controller +module Fake.Azure.WebJobs + +open System +open System.IO +open System.Net +open System.Text +open Fake.Core.Trace +open Fake.IO + +/// The running modes of webjobs +[] +type WebJobType = + | Continuous + | Triggered + +type WebClientWithTimeout() = + inherit WebClient() + member val Timeout = 600000 with get, set + + override x.GetWebRequest uri = + let r = base.GetWebRequest(uri) + r.Timeout <- x.Timeout + r + +/// WebJob type +type WebJob = + { + /// The name of the web job, this will also be the name out of zip file. + Name : string + /// Specifies what type of webjob this is. Note that this also determines it's deployment location on Azure + JobType : WebJobType + /// The project to be zipped and deployed as a webjob + Project : string + /// The directory path of the webjob to zip + DirectoryToPackage : string + /// The package path to once zipped + PackageLocation: string } + +/// The website that webjobs are deployed to +type WebSite = + { + /// The url of the website, usually in the format of https://.scm.azurewebsites.net + Url : Uri + /// The FTP username, usually the $username from the site's publish profile + UserName : string + /// The FTP Password + Password : string + /// The webjobs to deploy to this web site + WebJobs : WebJob list } + +let private jobTypePath webJobType = + match webJobType with + | WebJobType.Continuous -> "continuous" + | WebJobType.Triggered -> "triggered" + +let private zipWebJob webSite webJob = + let packageFile = FileInfo.ofPath webJob.PackageLocation + DirectoryInfo.ensure packageFile.Directory + let zipName = webJob.PackageLocation + let filesToZip = Directory.GetFiles(webJob.DirectoryToPackage, "*.*", SearchOption.AllDirectories) + tracefn "Zipping %s webjob to %s" webJob.Project webJob.PackageLocation + Zip.CreateZip webJob.DirectoryToPackage zipName "" 0 false filesToZip + +/// This task to can be used create a zip for each webjob to deploy to a website +/// The output structure is: `outputpath/{websitename}/webjobs/{continuous/triggered}/{webjobname}.zip` +/// ## Parameters +/// +/// - `webSites` - The websites and webjobs to build zips from. +let PackageWebJobs webSites = + webSites |> List.iter (fun webSite -> webSite.WebJobs |> List.iter (zipWebJob webSite)) + +let private deployWebJobToWebSite webSite webJob = + let uploadUri = Uri(webSite.Url, sprintf "api/%swebjobs/%s" (jobTypePath webJob.JobType) webJob.Name) + let filePath = webJob.PackageLocation + tracefn "Deploying %s webjob to %O" filePath uploadUri + use client = new WebClientWithTimeout(Credentials = NetworkCredential(webSite.UserName, webSite.Password)) + + client.Headers.Add(HttpRequestHeader.ContentType, "application/zip") + client.Headers.Add("Content-Disposition", sprintf "attachment; filename=%s" (Path.GetFileName webJob.PackageLocation)) + + let response = client.UploadFile(uploadUri, "PUT", filePath) + tracefn "Response from webjob upload: %s" (Encoding.ASCII.GetString response) + +let private deployWebJobsToWebSite webSite = + webSite.WebJobs |> List.iter (deployWebJobToWebSite webSite) + +/// This task to can be used deploy a prebuilt webjob zip to a website +/// ## Parameters +/// +/// - `webSites` - The websites and webjobs to deploy. +let DeployWebJobs webSites = + webSites |> List.iter deployWebJobsToWebSite \ No newline at end of file diff --git a/src/app/Fake.Azure.WebJobs/paket.references b/src/app/Fake.Azure.WebJobs/paket.references new file mode 100644 index 00000000000..30267960160 --- /dev/null +++ b/src/app/Fake.Azure.WebJobs/paket.references @@ -0,0 +1,8 @@ +group netcore + +FSharp.Core +NETStandard.Library +System.Diagnostics.FileVersionInfo +System.IO.Compression +System.IO.Compression.ZipFile +System.IO.FileSystem.Watcher \ No newline at end of file diff --git a/src/legacy/FakeLib/AzureKudu.fs b/src/legacy/FakeLib/AzureKudu.fs index 620115d97c4..9c79b0cfe41 100644 --- a/src/legacy/FakeLib/AzureKudu.fs +++ b/src/legacy/FakeLib/AzureKudu.fs @@ -93,6 +93,6 @@ let zipDeploy { Url = uri; UserName = username; Password = password; PackageLoca // Get the response. If 200 OK, then the deploy succeeded. Otherwise, the deploy failed. use response = request.GetResponse() :?> Net.HttpWebResponse if response.StatusCode = Net.HttpStatusCode.OK then - logfn "Deployed %s" uri.AbsoluteUri + tracefn "Deployed %s" uri.AbsoluteUri else failwithf "Failed to deploy package with status code %A" response.StatusCode From e001a5b64d0059c9c6da2670b2afd76375f37e27 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Tue, 6 Mar 2018 12:55:28 -0800 Subject: [PATCH 3/6] Use System.Net.Http rather than System.Net for .NET Core --- src/app/Fake.Azure.Kudu/Kudu.fs | 62 ++++++++++++++------- src/app/Fake.Azure.Kudu/paket.references | 1 + src/app/Fake.Azure.WebJobs/WebJobs.fs | 24 +++++++- src/app/Fake.Azure.WebJobs/paket.references | 3 +- 4 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/app/Fake.Azure.Kudu/Kudu.fs b/src/app/Fake.Azure.Kudu/Kudu.fs index 57e089e58ff..2c1778aa969 100644 --- a/src/app/Fake.Azure.Kudu/Kudu.fs +++ b/src/app/Fake.Azure.Kudu/Kudu.fs @@ -3,6 +3,11 @@ module Fake.Azure.Kudu open System open System.IO +#if NETSTANDARD +open System.Net.Http +#else +open System.Net +#endif open Fake.Core open Fake.Core.Environment open Fake.Core.Trace @@ -75,28 +80,43 @@ type ZipDeployParams = /// Synchronizes contents of the zip package with the target web app using Kudu ZipDeploy. /// See https://blogs.msdn.microsoft.com/appserviceteam/2017/10/16/zip-push-deployment-for-web-apps-functions-and-webjobs/ let zipDeploy { Url = uri; UserName = username; Password = password; PackageLocation = zipFile } = - // Create the web request. - let request = - Net.HttpWebRequest.Create(uri.AbsoluteUri + "api/zipdeploy", + let authToken = Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(username + ":" + password)) + + let statusCode = +#if NETSTANDARD + use client = new HttpClient(Timeout = 300000) + client.DefaultRequestHeaders.Authorization <- Headers.AuthenticationHeaderValue("Basic", authToken) + + use fileStream = new FileStream(zipFile, FileMode.Open) + use content = new StreamContent(fileStream) + content.Headers.ContentType <- Headers.MediaTypeHeaderValue("multipart/form-data") + + let response = client.PostAsync(uri.AbsoluteUri + "api/zipdeploy", content).Result + response.StatusCode +#else + // Create the web request. + let request = + HttpWebRequest.Create(uri.AbsoluteUri + "api/zipdeploy", Method = "POST", ContentType = "multipart/form-data", - Timeout = 300000) :?> Net.HttpWebRequest - - // Set the authorization header. - let authToken = - Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(sprintf "%s:%s" username password)) - request.Headers.Add("Authorization", sprintf "Basic %s" authToken) - - // Write the zip file to the request stream, then flush and close it to send. - do use fileStream = new FileStream(zipFile, FileMode.Open) - use inFile = request.GetRequestStream() - fileStream.CopyTo(inFile) - inFile.Flush() - inFile.Close() - - // Get the response. If 200 OK, then the deploy succeeded. Otherwise, the deploy failed. - use response = request.GetResponse() :?> Net.HttpWebResponse - if response.StatusCode = Net.HttpStatusCode.OK then + Timeout = 300000) :?> HttpWebRequest + + // Set the authorization header. + request.Headers.Add("Authorization", "Basic " + authToken) + + // Write the zip file to the request stream, then flush and close it to send. + do use fileStream = new FileStream(zipFile, FileMode.Open) + use inFile = request.GetRequestStream() + fileStream.CopyTo(inFile) + inFile.Flush() + inFile.Close() + + // Get the response. If 200 OK, then the deploy succeeded. Otherwise, the deploy failed. + use response = request.GetResponse() :?> Net.HttpWebResponse + response.StatusCode +#endif + + if statusCode = Net.HttpStatusCode.OK then tracefn "Deployed %s" uri.AbsoluteUri else - failwithf "Failed to deploy package with status code %A" response.StatusCode + failwithf "Failed to deploy package with status code %A" statusCode diff --git a/src/app/Fake.Azure.Kudu/paket.references b/src/app/Fake.Azure.Kudu/paket.references index 4a7b7c4619b..82f798ceea3 100644 --- a/src/app/Fake.Azure.Kudu/paket.references +++ b/src/app/Fake.Azure.Kudu/paket.references @@ -5,3 +5,4 @@ NETStandard.Library System.Diagnostics.FileVersionInfo System.Diagnostics.Process System.IO.FileSystem.Watcher +System.Net.Http diff --git a/src/app/Fake.Azure.WebJobs/WebJobs.fs b/src/app/Fake.Azure.WebJobs/WebJobs.fs index d2b19acbe00..a7a890c7d68 100644 --- a/src/app/Fake.Azure.WebJobs/WebJobs.fs +++ b/src/app/Fake.Azure.WebJobs/WebJobs.fs @@ -3,7 +3,11 @@ module Fake.Azure.WebJobs open System open System.IO +#if NETSTANDARD +open System.Net.Http +#else open System.Net +#endif open System.Text open Fake.Core.Trace open Fake.IO @@ -14,6 +18,8 @@ type WebJobType = | Continuous | Triggered +#if NETSTANDARD +#else type WebClientWithTimeout() = inherit WebClient() member val Timeout = 600000 with get, set @@ -22,6 +28,7 @@ type WebClientWithTimeout() = let r = base.GetWebRequest(uri) r.Timeout <- x.Timeout r +#endif /// WebJob type type WebJob = @@ -74,13 +81,28 @@ let private deployWebJobToWebSite webSite webJob = let uploadUri = Uri(webSite.Url, sprintf "api/%swebjobs/%s" (jobTypePath webJob.JobType) webJob.Name) let filePath = webJob.PackageLocation tracefn "Deploying %s webjob to %O" filePath uploadUri +#if NETSTANDARD + use client = new HttpClient(Timeout = 600000) + let authToken = Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(webSite.UserName + ":" + webSite.Password)) + client.DefaultRequestHeaders.Authorization <- Headers.AuthenticationHeaderValue("Basic", authToken) + + use fileStream = new FileStream(filePath, FileMode.Open) + use content = new StreamContent(fileStream) + content.Headers.ContentDisposition <- Headers.ContentDispositionHeaderValue("attachment; filename=" + (Path.GetFileName webJob.PackageLocation)) + content.Headers.ContentType <- Headers.MediaTypeHeaderValue("application/zip") + + let response = client.PutAsync(uploadUri, content).Result + let result = response.ReadAsStringAsync().Result + tracefn "Response from webjob upload: %s" result +#else use client = new WebClientWithTimeout(Credentials = NetworkCredential(webSite.UserName, webSite.Password)) client.Headers.Add(HttpRequestHeader.ContentType, "application/zip") - client.Headers.Add("Content-Disposition", sprintf "attachment; filename=%s" (Path.GetFileName webJob.PackageLocation)) + client.Headers.Add("Content-Disposition", "attachment; filename=" + (Path.GetFileName webJob.PackageLocation)) let response = client.UploadFile(uploadUri, "PUT", filePath) tracefn "Response from webjob upload: %s" (Encoding.ASCII.GetString response) +#endif let private deployWebJobsToWebSite webSite = webSite.WebJobs |> List.iter (deployWebJobToWebSite webSite) diff --git a/src/app/Fake.Azure.WebJobs/paket.references b/src/app/Fake.Azure.WebJobs/paket.references index 30267960160..2fa27199f4c 100644 --- a/src/app/Fake.Azure.WebJobs/paket.references +++ b/src/app/Fake.Azure.WebJobs/paket.references @@ -5,4 +5,5 @@ NETStandard.Library System.Diagnostics.FileVersionInfo System.IO.Compression System.IO.Compression.ZipFile -System.IO.FileSystem.Watcher \ No newline at end of file +System.IO.FileSystem.Watcher +System.Net.Http \ No newline at end of file From 68d284f6a612feb5631b37fa98acd6da3e28e0ff Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Tue, 6 Mar 2018 13:30:49 -0800 Subject: [PATCH 4/6] Fix remaining build errors --- src/app/Fake.Azure.CloudServices/CloudServices.fs | 4 +++- .../Fake.Azure.CloudServices.fsproj | 3 --- src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj | 3 --- src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj | 2 +- src/app/Fake.Azure.Kudu/Kudu.fs | 2 +- src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj | 2 +- src/app/Fake.Azure.WebJobs/WebJobs.fs | 6 +++--- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/app/Fake.Azure.CloudServices/CloudServices.fs b/src/app/Fake.Azure.CloudServices/CloudServices.fs index f694cb0ee7a..07d8b393366 100644 --- a/src/app/Fake.Azure.CloudServices/CloudServices.fs +++ b/src/app/Fake.Azure.CloudServices/CloudServices.fs @@ -43,7 +43,9 @@ let ModifyVMSize (VmSizes.VmSize vmSize) cloudService = "/svchost:ServiceDefinition/svchost:WorkerRole/@vmsize" vmSize [ "svchost", "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" ] - |> fun doc -> doc.Save csdefPath + |> fun doc -> + use fileStream = new FileStream(csdefPath, FileMode.Create) + doc.Save fileStream /// Packages a cloud service role into a .cspkg, ready for deployment. let PackageRole packageCloudServiceParams = diff --git a/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj b/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj index a1dacb00ecc..2ba7b7f4a8e 100644 --- a/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj +++ b/src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj @@ -4,9 +4,6 @@ Fake.Azure.CloudServices Library - - $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL - $(DefineConstants);RELEASE diff --git a/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj b/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj index f64c7851127..39cabeb6303 100644 --- a/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj +++ b/src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj @@ -4,9 +4,6 @@ Fake.Azure.Emulators Library - - $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL - $(DefineConstants);RELEASE diff --git a/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj b/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj index 9c7ce3d1740..3c8bcc23fa4 100644 --- a/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj +++ b/src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj @@ -5,7 +5,7 @@ Library - $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + $(DefineConstants);NETSTANDARD;USE_HTTPCLIENT $(DefineConstants);RELEASE diff --git a/src/app/Fake.Azure.Kudu/Kudu.fs b/src/app/Fake.Azure.Kudu/Kudu.fs index 2c1778aa969..5afafbd8b67 100644 --- a/src/app/Fake.Azure.Kudu/Kudu.fs +++ b/src/app/Fake.Azure.Kudu/Kudu.fs @@ -84,7 +84,7 @@ let zipDeploy { Url = uri; UserName = username; Password = password; PackageLoca let statusCode = #if NETSTANDARD - use client = new HttpClient(Timeout = 300000) + use client = new HttpClient(Timeout = TimeSpan.FromMilliseconds 300000.) client.DefaultRequestHeaders.Authorization <- Headers.AuthenticationHeaderValue("Basic", authToken) use fileStream = new FileStream(zipFile, FileMode.Open) diff --git a/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj b/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj index ec9aca66dd2..706af3f2f03 100644 --- a/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj +++ b/src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj @@ -5,7 +5,7 @@ Library - $(DefineConstants);FX_NO_REMOTING;USE_ASYNC_LOCAL + $(DefineConstants);NETSTANDARD;USE_HTTPCLIENT $(DefineConstants);RELEASE diff --git a/src/app/Fake.Azure.WebJobs/WebJobs.fs b/src/app/Fake.Azure.WebJobs/WebJobs.fs index a7a890c7d68..cca964d5928 100644 --- a/src/app/Fake.Azure.WebJobs/WebJobs.fs +++ b/src/app/Fake.Azure.WebJobs/WebJobs.fs @@ -82,7 +82,7 @@ let private deployWebJobToWebSite webSite webJob = let filePath = webJob.PackageLocation tracefn "Deploying %s webjob to %O" filePath uploadUri #if NETSTANDARD - use client = new HttpClient(Timeout = 600000) + use client = new HttpClient(Timeout = TimeSpan.FromMilliseconds 600000.) let authToken = Convert.ToBase64String(Text.Encoding.ASCII.GetBytes(webSite.UserName + ":" + webSite.Password)) client.DefaultRequestHeaders.Authorization <- Headers.AuthenticationHeaderValue("Basic", authToken) @@ -92,7 +92,7 @@ let private deployWebJobToWebSite webSite webJob = content.Headers.ContentType <- Headers.MediaTypeHeaderValue("application/zip") let response = client.PutAsync(uploadUri, content).Result - let result = response.ReadAsStringAsync().Result + let result = response.Content.ReadAsStringAsync().Result tracefn "Response from webjob upload: %s" result #else use client = new WebClientWithTimeout(Credentials = NetworkCredential(webSite.UserName, webSite.Password)) @@ -112,4 +112,4 @@ let private deployWebJobsToWebSite webSite = /// /// - `webSites` - The websites and webjobs to deploy. let DeployWebJobs webSites = - webSites |> List.iter deployWebJobsToWebSite \ No newline at end of file + webSites |> List.iter deployWebJobsToWebSite From 1efbe01017a2b5efa698f9643cd9645a283308a3 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Wed, 7 Mar 2018 08:51:06 -0800 Subject: [PATCH 5/6] Attempt to fix Travis build --- Fake.sln | 78 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/Fake.sln b/Fake.sln index af05b8d3441..481f8d4355c 100644 --- a/Fake.sln +++ b/Fake.sln @@ -4,85 +4,85 @@ VisualStudioVersion = 15.0.27130.2026 MinimumVisualStudioVersion = 15.0.26124.0 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{7BFFAE76-DEE9-417A-A79B-6A6644C4553A}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Context", "src\app\Fake.Core.Context\Fake.Core.Context.fsproj", "{D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Context", "src/app/Fake.Core.Context/Fake.Core.Context.fsproj", "{D3D92ED7-C2B9-46D5-B611-A2CF0C30C8DB}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Environment", "src\app\Fake.Core.Environment\Fake.Core.Environment.fsproj", "{A2C4A85F-24C4-4FFA-B165-4807B1127C4E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Environment", "src/app/Fake.Core.Environment/Fake.Core.Environment.fsproj", "{A2C4A85F-24C4-4FFA-B165-4807B1127C4E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Process", "src\app\Fake.Core.Process\Fake.Core.Process.fsproj", "{DB09FF66-8750-40B8-9E25-70FADD9CF0BD}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Process", "src/app/Fake.Core.Process/Fake.Core.Process.fsproj", "{DB09FF66-8750-40B8-9E25-70FADD9CF0BD}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.ReleaseNotes", "src\app\Fake.Core.ReleaseNotes\Fake.Core.ReleaseNotes.fsproj", "{FEDE1F15-C0A5-4DA1-B20D-0A0C28F6858E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.ReleaseNotes", "src/app/Fake.Core.ReleaseNotes/Fake.Core.ReleaseNotes.fsproj", "{FEDE1F15-C0A5-4DA1-B20D-0A0C28F6858E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.SemVer", "src\app\Fake.Core.SemVer\Fake.Core.SemVer.fsproj", "{AFCCC2AB-EFFE-4CAE-ACAD-3434B04D3A4E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.SemVer", "src/app/Fake.Core.SemVer/Fake.Core.SemVer.fsproj", "{AFCCC2AB-EFFE-4CAE-ACAD-3434B04D3A4E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.String", "src\app\Fake.Core.String\Fake.Core.String.fsproj", "{D5B2FEB2-BA3A-492D-B83D-414835043D86}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.String", "src/app/Fake.Core.String/Fake.Core.String.fsproj", "{D5B2FEB2-BA3A-492D-B83D-414835043D86}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Trace", "src\app\Fake.Core.Trace\Fake.Core.Trace.fsproj", "{9430365D-C956-4290-A006-A87F9083DC4B}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Trace", "src/app/Fake.Core.Trace/Fake.Core.Trace.fsproj", "{9430365D-C956-4290-A006-A87F9083DC4B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Target", "src\app\Fake.Core.Target\Fake.Core.Target.fsproj", "{0C28F2FB-2B12-4893-AAA4-2C2548926847}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Target", "src/app/Fake.Core.Target/Fake.Core.Target.fsproj", "{0C28F2FB-2B12-4893-AAA4-2C2548926847}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Tasks", "src\app\Fake.Core.Tasks\Fake.Core.Tasks.fsproj", "{83860B89-4A95-49A5-B4D6-B8F3345498E9}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Tasks", "src/app/Fake.Core.Tasks/Fake.Core.Tasks.fsproj", "{83860B89-4A95-49A5-B4D6-B8F3345498E9}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Xml", "src\app\Fake.Core.Xml\Fake.Core.Xml.fsproj", "{C3C12DCE-7AC4-4E97-A7FC-49189D218885}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.Xml", "src/app/Fake.Core.Xml/Fake.Core.Xml.fsproj", "{C3C12DCE-7AC4-4E97-A7FC-49189D218885}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.AssemblyInfoFile", "src\app\Fake.DotNet.AssemblyInfoFile\Fake.DotNet.AssemblyInfoFile.fsproj", "{BB293F2E-C3BD-4F1C-8345-8AEF01998D2C}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.AssemblyInfoFile", "src/app/Fake.DotNet.AssemblyInfoFile/Fake.DotNet.AssemblyInfoFile.fsproj", "{BB293F2E-C3BD-4F1C-8345-8AEF01998D2C}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Cli", "src\app\Fake.DotNet.Cli\Fake.DotNet.Cli.fsproj", "{B2C0063A-FC66-4883-BB69-B1DBE6BF9CA2}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Cli", "src/app/Fake.DotNet.Cli/Fake.DotNet.Cli.fsproj", "{B2C0063A-FC66-4883-BB69-B1DBE6BF9CA2}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MsBuild", "src\app\Fake.DotNet.MsBuild\Fake.DotNet.MsBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.MsBuild", "src/app/Fake.DotNet.MsBuild/Fake.DotNet.MsBuild.fsproj", "{64195C50-E138-4218-A7CE-13CD4565B87E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.NuGet", "src\app\Fake.DotNet.NuGet\Fake.DotNet.NuGet.fsproj", "{93F1A71E-54E2-4C65-BB1E-1D499890317F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.NuGet", "src/app/Fake.DotNet.NuGet/Fake.DotNet.NuGet.fsproj", "{93F1A71E-54E2-4C65-BB1E-1D499890317F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSpec", "src\app\Fake.DotNet.Testing.MSpec\Fake.DotNet.Testing.MSpec.fsproj", "{C1B87E1F-8D0D-4A78-9A24-9D5D38B7E9A8}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSpec", "src/app/Fake.DotNet.Testing.MSpec/Fake.DotNet.Testing.MSpec.fsproj", "{C1B87E1F-8D0D-4A78-9A24-9D5D38B7E9A8}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.NUnit", "src\app\Fake.DotNet.Testing.NUnit\Fake.DotNet.Testing.NUnit.fsproj", "{75C9DD21-B4EA-4117-BF4F-AFE777A80B5B}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.NUnit", "src/app/Fake.DotNet.Testing.NUnit/Fake.DotNet.Testing.NUnit.fsproj", "{75C9DD21-B4EA-4117-BF4F-AFE777A80B5B}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.XUnit2", "src\app\Fake.DotNet.Testing.XUnit2\Fake.DotNet.Testing.XUnit2.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F39}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.XUnit2", "src/app/Fake.DotNet.Testing.XUnit2/Fake.DotNet.Testing.XUnit2.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F39}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSTest", "src\app\Fake.DotNet.Testing.MSTest\Fake.DotNet.Testing.MSTest.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F30}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.MSTest", "src/app/Fake.DotNet.Testing.MSTest/Fake.DotNet.Testing.MSTest.fsproj", "{21E2FE31-4E7C-489E-8215-9303108A2F30}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.FileSystem", "src\app\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj", "{4B1416CD-C7CB-4670-8EFE-871ED316D51D}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.FileSystem", "src/app/Fake.IO.FileSystem/Fake.IO.FileSystem.fsproj", "{4B1416CD-C7CB-4670-8EFE-871ED316D51D}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.Zip", "src\app\Fake.IO.Zip\Fake.IO.Zip.fsproj", "{46ED6A9C-C5BF-4495-924E-478736FC280E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.IO.Zip", "src/app/Fake.IO.Zip/Fake.IO.Zip.fsproj", "{46ED6A9C-C5BF-4495-924E-478736FC280E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Runtime", "src\app\Fake.Runtime\Fake.Runtime.fsproj", "{44A3F022-D70A-422D-B850-824BB572F2AF}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Runtime", "src/app/Fake.Runtime/Fake.Runtime.fsproj", "{44A3F022-D70A-422D-B850-824BB572F2AF}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.Common", "src\app\Fake.Testing.Common\Fake.Testing.Common.fsproj", "{7D629246-957C-4989-A1E6-29C673086925}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.Common", "src/app/Fake.Testing.Common/Fake.Testing.Common.fsproj", "{7D629246-957C-4989-A1E6-29C673086925}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Windows.Chocolatey", "src\app\Fake.Windows.Chocolatey\Fake.Windows.Chocolatey.fsproj", "{A95B731B-5887-4EF5-A64D-B643FA8EBD92}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Windows.Chocolatey", "src/app/Fake.Windows.Chocolatey/Fake.Windows.Chocolatey.fsproj", "{A95B731B-5887-4EF5-A64D-B643FA8EBD92}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Git", "src\app\Fake.Tools.Git\Fake.Tools.Git.fsproj", "{E32B2631-476A-4C2D-AE18-275ED7A22F10}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Tools.Git", "src/app/Fake.Tools.Git/Fake.Tools.Git.fsproj", "{E32B2631-476A-4C2D-AE18-275ED7A22F10}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.FSFormatting", "src\app\Fake.DotNet.FSFormatting\Fake.DotNet.FSFormatting.fsproj", "{80314941-78D5-4928-B943-93FC945E050F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.FSFormatting", "src/app/Fake.DotNet.FSFormatting/Fake.DotNet.FSFormatting.fsproj", "{80314941-78D5-4928-B943-93FC945E050F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Paket", "src\app\Fake.DotNet.Paket\Fake.DotNet.Paket.fsproj", "{CDFB2B10-050A-4188-8F72-2BCC61E9814F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Paket", "src/app/Fake.DotNet.Paket/Fake.DotNet.Paket.fsproj", "{CDFB2B10-050A-4188-8F72-2BCC61E9814F}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.netcore", "src\app\Fake.netcore\Fake.netcore.fsproj", "{6B339DA3-8DED-4262-A427-3C4CCDD00650}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.netcore", "src/app/Fake.netcore/Fake.netcore.fsproj", "{6B339DA3-8DED-4262-A427-3C4CCDD00650}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.SonarQube", "src\app\Fake.Testing.SonarQube\Fake.Testing.SonarQube.fsproj", "{2A985028-4410-40F7-992C-5397DC1ED116}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Testing.SonarQube", "src/app/Fake.Testing.SonarQube/Fake.Testing.SonarQube.fsproj", "{2A985028-4410-40F7-992C-5397DC1ED116}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.OpenCover", "src\app\Fake.DotNet.Testing.OpenCover\Fake.DotNet.Testing.OpenCover.fsproj", "{A9AF015B-43C9-405E-BF74-CE936B8418F9}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Testing.OpenCover", "src/app/Fake.DotNet.Testing.OpenCover/Fake.DotNet.Testing.OpenCover.fsproj", "{A9AF015B-43C9-405E-BF74-CE936B8418F9}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.Slack", "src\app\Fake.Api.Slack\Fake.Api.Slack.fsproj", "{58A3EDF0-CA9D-4757-B1E8-2A4E3592B308}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.Slack", "src/app/Fake.Api.Slack/Fake.Api.Slack.fsproj", "{58A3EDF0-CA9D-4757-B1E8-2A4E3592B308}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.GitHub", "src\app\Fake.Api.GitHub\Fake.Api.GitHub.fsproj", "{4BCE4F9C-8FC2-4207-81F1-20CB07D852DC}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Api.GitHub", "src/app/Fake.Api.GitHub/Fake.Api.GitHub.fsproj", "{4BCE4F9C-8FC2-4207-81F1-20CB07D852DC}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Xamarin", "src\app\Fake.DotNet.Xamarin\Fake.DotNet.Xamarin.fsproj", "{13C1F95D-2FAD-4890-BF94-0AE7CF9AB2FC}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.DotNet.Xamarin", "src/app/Fake.DotNet.Xamarin/Fake.DotNet.Xamarin.fsproj", "{13C1F95D-2FAD-4890-BF94-0AE7CF9AB2FC}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Net.Http", "src\app\Fake.Net.Http\Fake.Net.Http.fsproj", "{D24CEE35-B6C0-4C92-AE18-E80F90B69974}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Net.Http", "src/app/Fake.Net.Http/Fake.Net.Http.fsproj", "{D24CEE35-B6C0-4C92-AE18-E80F90B69974}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "dotnet-fake", "src\app\dotnet-fake\dotnet-fake.fsproj", "{DB27F0BB-D546-42B2-85DA-52870B4424FD}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "dotnet-fake", "src/app/dotnet-fake/dotnet-fake.fsproj", "{DB27F0BB-D546-42B2-85DA-52870B4424FD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCAC5CAB-03C8-4C11-ADBE-A0D05F6A4F18}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.UnitTests", "src\test\Fake.Core.UnitTests\Fake.Core.UnitTests.fsproj", "{31A5759B-B562-43C0-A845-14EFA4091543}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Core.UnitTests", "src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj", "{31A5759B-B562-43C0-A845-14EFA4091543}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.CloudServices", "src\app\Fake.Azure.CloudServices\Fake.Azure.CloudServices.fsproj", "{D8850C67-0542-427A-ABCB-92174EA42C95}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.CloudServices", "src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj", "{D8850C67-0542-427A-ABCB-92174EA42C95}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Emulators", "src\app\Fake.Azure.Emulators\Fake.Azure.Emulators.fsproj", "{8D72BED1-BC02-4B23-A631-4849BD0FD3E1}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Emulators", "src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj", "{8D72BED1-BC02-4B23-A631-4849BD0FD3E1}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Kudu", "src\app\Fake.Azure.Kudu\Fake.Azure.Kudu.fsproj", "{A1CAA84D-3C99-4218-AFB6-55EE2288800E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.Kudu", "src/app/Fake.Azure.Kudu/Fake.Azure.Kudu.fsproj", "{A1CAA84D-3C99-4218-AFB6-55EE2288800E}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.WebJobs", "src\app\Fake.Azure.WebJobs\Fake.Azure.WebJobs.fsproj", "{F15967FF-E905-4CAD-9545-E59E0F47AD8E}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fake.Azure.WebJobs", "src/app/Fake.Azure.WebJobs/Fake.Azure.WebJobs.fsproj", "{F15967FF-E905-4CAD-9545-E59E0F47AD8E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From a83ca62923d0361feb187d86b7d41cce9d590ea7 Mon Sep 17 00:00:00 2001 From: Ryan Riley Date: Wed, 7 Mar 2018 12:04:50 -0800 Subject: [PATCH 6/6] Address code review --- src/app/Fake.Azure.Kudu/Kudu.fs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/Fake.Azure.Kudu/Kudu.fs b/src/app/Fake.Azure.Kudu/Kudu.fs index 5afafbd8b67..600c7f60a6e 100644 --- a/src/app/Fake.Azure.Kudu/Kudu.fs +++ b/src/app/Fake.Azure.Kudu/Kudu.fs @@ -10,7 +10,6 @@ open System.Net #endif open Fake.Core open Fake.Core.Environment -open Fake.Core.Trace open Fake.IO /// Location where staged outputs should go before synced up to the site. @@ -29,8 +28,8 @@ type WebJobType = Scheduled | Continuous // Some initial cleanup / prep do - Directory.CreateDirectory deploymentTemp |> ignore - Directory.CreateDirectory deploymentTarget |> ignore + Directory.ensure deploymentTemp |> ignore + Directory.ensure deploymentTarget |> ignore Shell.CleanDir deploymentTemp /// @@ -51,7 +50,7 @@ let getWebJobPath webJobType webJobName = /// Stages a set of files into a WebJob folder in the temp deployment area, ready for deployment into the website as a webjob. let stageWebJob webJobType webJobName files = let webJobPath = getWebJobPath webJobType webJobName - Directory.CreateDirectory webJobPath |> ignore + Directory.ensure webJobPath |> ignore files |> Shell.CopyFiles webJobPath /// Synchronises all staged files from the temporary deployment to the actual deployment, removing @@ -117,6 +116,6 @@ let zipDeploy { Url = uri; UserName = username; Password = password; PackageLoca #endif if statusCode = Net.HttpStatusCode.OK then - tracefn "Deployed %s" uri.AbsoluteUri + Trace.tracefn "Deployed %s" uri.AbsoluteUri else failwithf "Failed to deploy package with status code %A" statusCode