forked from aspnet/dnvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.shade
65 lines (52 loc) · 2.85 KB
/
makefile.shade
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
use import="Files"
use import="BuildEnv"
use import="Environment"
var PRODUCT_VERSION = '1.0.0'
var AUTHORS='Microsoft Open Technologies, Inc.'
use-standard-lifecycle
default BASE_DIR='${Directory.GetCurrentDirectory()}'
default TARGET_DIR='${Path.Combine(BASE_DIR, "artifacts")}'
default SOURCE_DIR='${Path.Combine(BASE_DIR, "src")}'
default BUILD_DIR='${Path.Combine(BASE_DIR, "build")}'
default TEST_DIR='${Path.Combine(BASE_DIR, "test")}'
default Configuration='${GetEnvironmentVariable("Configuration")}'
@{
if (string.IsNullOrEmpty(GetEnvironmentVariable("DNX_BUILD_VERSION")))
{
SetEnvironmentVariable("DNX_BUILD_VERSION", BuildNumber);
}
if (string.IsNullOrEmpty(GetEnvironmentVariable("K_AUTHOR")))
{
SetEnvironmentVariable("K_AUTHOR", AUTHORS);
}
if (string.IsNullOrEmpty(Configuration))
{
Configuration = "Debug";
SetEnvironmentVariable("Configuration", Configuration);
}
}
default DEPLOY_DNVM="${Environment.GetEnvironmentVariable("DEPLOY_DNVM")}"
default DNVM_DEPLOY_REPO="${Environment.GetEnvironmentVariable("DNVM_DEPLOY_REPO")}"
default DNVM_DEPLOY_BRANCH="${Environment.GetEnvironmentVariable("DNVM_DEPLOY_BRANCH")}"
#copy-dnvm target='compile'
copy sourceDir='${SOURCE_DIR}' outputDir='${TARGET_DIR}' include='*.*' overwrite='${true}'
update-file updateFile='${Path.Combine(TARGET_DIR, "dnvm.ps1")}' @{
updateText = updateText
.Replace("{{BUILD_VERSION}}", Environment.GetEnvironmentVariable("DNX_BUILD_VERSION"))
.Replace("{{AUTHORS}}", AUTHORS);
}
update-file updateFile='${Path.Combine(TARGET_DIR, "dnvm.sh")}' @{
updateText = updateText
.Replace("{{BUILD_VERSION}}", Environment.GetEnvironmentVariable("DNX_BUILD_VERSION"))
.Replace("{{AUTHORS}}", AUTHORS);
}
#run-ps1-tests target='test' if='!IsLinux'
exec program='powershell' commandline='-ExecutionPolicy RemoteSigned -NoProfile -NoLogo -Command & "${Path.Combine(TEST_DIR, "ps1", "Run-Tests.ps1")} ${IsTeamCity?"-TeamCity":""}'
#run-sh-tests target='test' if='IsLinux'
exec program='/bin/bash' commandline="${Path.Combine(TEST_DIR, "sh", "run-tests.sh")} ${IsTeamCity?"-t ":""}-v" workingdir="${Path.Combine(TEST_DIR, "sh")}"
#push-dnvm target='deploy' if='DEPLOY_DNVM == "1" && !String.IsNullOrEmpty(DNVM_DEPLOY_REPO) && !String.IsNullOrEmpty(DNVM_DEPLOY_BRANCH)'
push-dnvm repo="${DNVM_DEPLOY_REPO}" branch="${DNVM_DEPLOY_BRANCH}" files="${Path.Combine(TARGET_DIR, "dnvm.cmd")};${Path.Combine(TARGET_DIR, "dnvm.ps1")};${Path.Combine(TARGET_DIR, "dnvm.sh")}" baseMessage=":arrow_up: dnvm.ps1, dnvm.cmd, dnvm.sh"
functions @{
string GetEnvironmentVariable(string key) { return Environment.GetEnvironmentVariable(key); }
void SetEnvironmentVariable(string key, string value) { Environment.SetEnvironmentVariable(key, value); }
}