-
Notifications
You must be signed in to change notification settings - Fork 0
/
EdmxConv.cake
96 lines (80 loc) · 2.75 KB
/
EdmxConv.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#tool "nuget:?package=xunit.runner.console"
#addin "Cake.WebDeploy"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var solutionPath = "./EdmxConv.sln";
//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./src/**/bin");
CleanDirectories("./src/**/published_website");
CleanDirectory("./artifacts", f => !f.Hidden && !f.Path.FullPath.Contains("keep") );
});
Task("RestoreNugets")
.IsDependentOn("Clean")
.Does(() =>
{
NuGetRestore(solutionPath);
});
Task("Build")
.IsDependentOn("RestoreNugets")
.Does(() =>
{
// Use MSBuild
MSBuild(solutionPath, settings =>
settings.SetConfiguration(configuration));
});
Task("UnitTest")
.IsDependentOn("Build")
.Does(() =>
{
var testAssemblies = GetFiles("./tests/**/*.Tests.dll");
XUnit2(testAssemblies,
new XUnit2Settings {
Parallelism = ParallelismOption.All,
HtmlReport = true,
NoAppDomain = true,
OutputDirectory = "./build"
});
});
Task("Publish-Local")
.IsDependentOn("Clean")
.IsDependentOn("RestoreNugets")
.Does(() => {
MSBuild(solutionPath, settings =>
settings.SetConfiguration(configuration)
.WithProperty("DeployOnBuild", "true")
.WithProperty("PublishProfile", "Local"));
Zip("./src/EdmxConv.WebAPI/published", "./artifacts/published.zip");
});
//Task("Deploy-ToAzure")
// //.IsDependentOn("Publish-Local")
// .Does(() => {
// DeployWebsite(new DeploySettings()
// {
// SourcePath = "./artifacts/published.zip",
// PublishUrl = "https://edmxconvapp.scm.azurewebsites.net:443/",
//
// SiteName = "EdmxConv",
// Username = EnvironmentVariable("EDMX_AZURE_USER"),
// Password = EnvironmentVariable("EDMX_AZURE_PASS")
// });
// });
//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("UnitTest");
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
RunTarget(target);