-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
78 lines (68 loc) · 1.99 KB
/
build.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
#addin nuget:?package=Cake.Kudu.Client&version=0.4.0
string target = Argument("target", "Default"),
configuration = Argument("configuration", "Release"),
solution = "./src/ShippedFromBitrise.sln",
project = "./src/ShippedFromBitrise/ShippedFromBitrise.csproj",
testProject = "./src/ShippedFromBitrise.Tests/ShippedFromBitrise.Tests.csproj",
output = "./output",
baseUri = EnvironmentVariable("KUDU_CLIENT_BASEURI"),
userName = EnvironmentVariable("KUDU_CLIENT_USERNAME"),
password = EnvironmentVariable("KUDU_CLIENT_PASSWORD");
Task("Restore")
.Does( () => {
DotNetCoreRestore(solution);
});
Task("Clean")
.Does( () => {
CleanDirectory(output);
});
Task("Build")
.IsDependentOn("Restore")
.IsDependentOn("Clean")
.Does( () => {
DotNetCoreBuild(
solution,
new DotNetCoreBuildSettings {
NoRestore = true,
Configuration = configuration
});
});
Task("Test")
.IsDependentOn("Build")
.Does( () => {
DotNetCoreTest(
testProject,
new DotNetCoreTestSettings {
NoRestore = false,
NoBuild = false,
Configuration = configuration,
OutputDirectory = output
});
});
Task("Publish")
.IsDependentOn("Test")
.Does( () => {
DotNetCorePublish(
project,
new DotNetCorePublishSettings {
NoRestore = false,
Configuration = configuration,
OutputDirectory = output
});
});
Task("Deploy")
.IsDependentOn("Publish")
.WithCriteria(
!string.IsNullOrEmpty(baseUri) &&
!string.IsNullOrEmpty(userName) &&
!string.IsNullOrEmpty(password))
.Does( () => {
IKuduClient kuduClient = KuduClient(
baseUri,
userName,
password);
kuduClient.ZipDeployDirectory(output);
});
Task("Default")
.IsDependentOn("Deploy");
RunTarget(target);