-
Notifications
You must be signed in to change notification settings - Fork 7
/
Komponentkartan_build.cake
63 lines (54 loc) · 1.15 KB
/
Komponentkartan_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
#addin "Cake.MsDeploy"
#addin "Cake.Npm"
#addin "Cake.Powershell"
var target = Argument("target", "Default");
var environment = Argument("environment", "Local");
var deployServer = string.Empty;
Task("Validate-Arguments")
.Does(() =>
{
switch(environment)
{
case "Local":
break;
case "Test":
break;
case "Demo":
break;
default:
throw new Exception(string.Format(
"{0} is not a valid environment. Valid environments are: Local, Test, Demo.",
environment));
}
Verbose("Environment: {0}", environment);
});
Task("Restore-NpmPackages")
.Does(() =>
{
NpmInstall(new NpmInstallSettings
{
WorkingDirectory = "./",
Production = false
});
});
Task("Run-Jasmine-Tests")
.IsDependentOn("Build-Frontend")
.Does(() =>
{
NpmRunScript(new NpmRunScriptSettings
{
ScriptName = "test-ci",
WorkingDirectory = "./",
});
});
Task("Build-Frontend")
.IsDependentOn("Restore-NpmPackages")
.Does(() => {
NpmRunScript(new NpmRunScriptSettings
{
ScriptName = "build",
WorkingDirectory = "./"
});
});
Task("Default").IsDependentOn("Run-Jasmine-Tests");
RunTarget(target);