-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cake
65 lines (55 loc) · 1.17 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
#addin "nuget:?package=Cake.Figlet&version=1.2.0"
#addin "nuget:?package=Cake.Docker&version=0.9.9"
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var tag = Argument("tag", "schost:latest");
var output = Argument("output", "");
Setup(ctx => {
Information("");
Information(Figlet("Sitecore Host"));
Information("Basic Sitecore Host Application");
});
Task("Clean")
.Does(() =>
{
DotNetCoreClean("./src/ScHost");
}
);
Task("Publish")
.IsDependentOn("Clean")
.Does(() =>
{
var settings = new DotNetCorePublishSettings {
Configuration = configuration
};
if (!string.IsNullOrEmpty(output))
{
settings.OutputDirectory = output;
}
DotNetCorePublish("./src/ScHost/ScHost.csproj", settings);
});
Task("Docker Build")
.Does(() => {
DockerBuild(
new DockerImageBuildSettings {
Rm = true,
Isolation = "process",
Tag = new string[] { tag }
},
"."
);
});
Task("Docker Run")
.IsDependentOn("Docker Build")
.Does(() => {
DockerRun(
new DockerContainerRunSettings {
Isolation = "process"
},
tag,
""
);
});
Task("Default")
.IsDependentOn("Publish");
RunTarget(target);