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 support for Kudu Zip Deploy #1757

Merged
merged 6 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
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
60 changes: 60 additions & 0 deletions Fake.sln
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCAC5CAB-0
EndProject
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
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions src/app/Fake.Azure.CloudServices/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Auto-Generated by FAKE; do not edit
namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("FAKE - F# Make Azure Cloud Services Support")>]
[<assembly: AssemblyProductAttribute("FAKE - F# Make")>]
[<assembly: AssemblyVersionAttribute("5.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("5.0.0")>]
[<assembly: AssemblyFileVersionAttribute("5.0.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "FAKE - F# Make Azure Cloud Services Support"
let [<Literal>] AssemblyProduct = "FAKE - F# Make"
let [<Literal>] AssemblyVersion = "5.0.0"
let [<Literal>] AssemblyInformationalVersion = "5.0.0"
let [<Literal>] AssemblyFileVersion = "5.0.0"
97 changes: 97 additions & 0 deletions src/app/Fake.Azure.CloudServices/CloudServices.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/// 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.
[<CLIMutable>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove CLIMutable here?

Copy link
Contributor Author

@panesofglass panesofglass Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied all this from the FakeLib project in an attempt to be helpful to get this moved to Fake 5.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I know and this helps a lot! I just like APIs to be more consistent in fake5 so we can improve the code while porting - this moves the project forward. I see that people want to use stuff on fake5. That’s why I said the items are suggestions just in case you agree with them and have a minute ;)

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version is a float?

Copy link
Contributor Author

@panesofglass panesofglass Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied all this from the FakeLib project in an attempt to be helpful to get this moved to Fake 5.

/// 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 ->
use fileStream = new FileStream(csdefPath, FileMode.Create)
doc.Save fileStream

/// 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
<| ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit unusual

Copy link
Contributor Author

@panesofglass panesofglass Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied all this from the FakeLib project in an attempt to be helpful to get this moved to Fake 5.


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 = [] })
23 changes: 23 additions & 0 deletions src/app/Fake.Azure.CloudServices/Fake.Azure.CloudServices.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>net46;netstandard1.6;netstandard2.0</TargetFrameworks>
<AssemblyName>Fake.Azure.CloudServices</AssemblyName>
<OutputType>Library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="CloudServices.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fake.Core.Context\Fake.Core.Context.fsproj" />
<ProjectReference Include="..\Fake.Core.Environment\Fake.Core.Environment.fsproj" />
<ProjectReference Include="..\Fake.Core.Process\Fake.Core.Process.fsproj" />
<ProjectReference Include="..\Fake.Core.String\Fake.Core.String.fsproj" />
<ProjectReference Include="..\Fake.Core.Xml\Fake.Core.Xml.fsproj" />
<ProjectReference Include="..\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj" />
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
</Project>
12 changes: 12 additions & 0 deletions src/app/Fake.Azure.CloudServices/paket.references
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions src/app/Fake.Azure.Emulators/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Auto-Generated by FAKE; do not edit
namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("FAKE - F# Make Azure Emulators Support")>]
[<assembly: AssemblyProductAttribute("FAKE - F# Make")>]
[<assembly: AssemblyVersionAttribute("5.0.0")>]
[<assembly: AssemblyInformationalVersionAttribute("5.0.0")>]
[<assembly: AssemblyFileVersionAttribute("5.0.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "FAKE - F# Make Azure Emulators Support"
let [<Literal>] AssemblyProduct = "FAKE - F# Make"
let [<Literal>] AssemblyVersion = "5.0.0"
let [<Literal>] AssemblyInformationalVersion = "5.0.0"
let [<Literal>] AssemblyFileVersion = "5.0.0"
85 changes: 85 additions & 0 deletions src/app/Fake.Azure.Emulators/Emulators.fs
Original file line number Diff line number Diff line change
@@ -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
[<CLIMutable>]
type private AzureEmulatorParams = {
StorageEmulatorToolPath:Lazy<string>
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need some more information here, if you want to hide it you can use inner exceptions, like
raise <| exn("Azure Emulator Failure ...", exn(sprintf "Process exited with code %d" exitCode))

But that is only a suggestion if you left that information out on purpose, otherwise we might just include the exit code in the error message...

Copy link
Contributor Author

@panesofglass panesofglass Mar 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied all this from the FakeLib project in an attempt to be helpful to get this moved to Fake 5.

)

/// 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"
)
23 changes: 23 additions & 0 deletions src/app/Fake.Azure.Emulators/Fake.Azure.Emulators.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>net46;netstandard1.6;netstandard2.0</TargetFrameworks>
<AssemblyName>Fake.Azure.Emulators</AssemblyName>
<OutputType>Library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Emulators.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Fake.Core.Context\Fake.Core.Context.fsproj" />
<ProjectReference Include="..\Fake.Core.Environment\Fake.Core.Environment.fsproj" />
<ProjectReference Include="..\Fake.Core.Process\Fake.Core.Process.fsproj" />
<ProjectReference Include="..\Fake.Core.String\Fake.Core.String.fsproj" />
<ProjectReference Include="..\Fake.Core.Trace\Fake.Core.Trace.fsproj" />
<ProjectReference Include="..\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj" />
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
</Project>
7 changes: 7 additions & 0 deletions src/app/Fake.Azure.Emulators/paket.references
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
group netcore

FSharp.Core
NETStandard.Library
System.Diagnostics.FileVersionInfo
System.Diagnostics.Process
System.IO.FileSystem.Watcher
Loading