-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cake
More file actions
50 lines (40 loc) · 1.21 KB
/
build.cake
File metadata and controls
50 lines (40 loc) · 1.21 KB
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
#addin nuget:?package=Cake.Docker&version=0.11.1
var target = Argument("Target", "Default");
var builSettings = new DotNetCoreBuildSettings
{
Configuration = "Debug"
};
class DockerBuildSettingsParameters
{
public string Tag;
}
Setup<DockerBuildSettingsParameters>(ctx => new DockerBuildSettingsParameters()
{
Tag = ctx.Argument("tag", "onion-sample-app:1.0")
});
Task("Restore")
.Does(_ => DotNetCoreRestore());
Task("Clean")
.Does(_ => DotNetCoreClean("."));
Task("BuildClient")
.Does(_ => DotNetCoreBuild("./SampleApp.Client/SampleApp.Client.csproj"));
Task("BuildServer")
.Does(_ => DotNetCoreBuild("./SampleApp.Server/SampleApp.Server.csproj"));
Task("Build")
.IsDependentOn("BuildClient")
.IsDependentOn("BuildServer");
Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.IsDependentOn("Build");
Task("BuildServerDocker")
.Does<DockerBuildSettingsParameters>(p => {
Information($"docker tag: {p.Tag}");
var settings = new DockerImageBuildSettings
{
File = "./SampleApp.Server/Dockerfile",
Tag = new string[] { p.Tag }
};
DockerBuild(settings, ".");
});
RunTarget(target);