-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.cake
40 lines (30 loc) · 918 Bytes
/
deploy.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
#addin Cake.WebDeploy
var target = Argument("target", "Default");
var machine = EnvironmentVariable("PUBLISH_MACHINE");
var site = EnvironmentVariable("PUBLISH_SITE");
var username = EnvironmentVariable("PUBLISH_CREDENTIALS_USR");
var password = EnvironmentVariable("PUBLISH_CREDENTIALS_PSW");
if (string.IsNullOrWhiteSpace(machine)) {
Error("Publish machine not provided.");
return;
}
if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password)) {
Error("Publish credentials not provided.");
return;
}
Task("Deploy")
.Does(() =>
{
DeployWebsite(new DeploySettings()
{
SourcePath = "./release/release.zip",
UseAppOffline = true,
SiteName = site,
ComputerName = machine,
Username = username,
Password = password
});
});
Task("Default")
.IsDependentOn("Deploy");
RunTarget(target);