-
Notifications
You must be signed in to change notification settings - Fork 11
/
.space.kts
119 lines (99 loc) · 3.23 KB
/
.space.kts
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
val buildContainerImage = "ubuntu:22.04"
val buildScript = """
apt-get update && apt-get install -y apt-utils apt-transport-https
apt-get install -y curl unzip wget software-properties-common git
wget https://dot.net/v1/dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 6.0
./dotnet-install.sh --channel 7.0
./dotnet-install.sh --channel 8.0
PATH=${'$'}PATH:${'$'}HOME/.dotnet:${'$'}HOME/.dotnet/tools
dotnet --list-sdks
./build.sh
""".trimIndent()
job("Continuous integration build") {
startOn {
gitPush {
enabled = true
branchFilter {
-"refs/merge/*"
-"refs/pull/*"
}
}
}
container(buildContainerImage) {
resources {
cpu = 2.cpu
memory = 4.gb
}
env.set("DOTNET_NOLOGO", "true")
env.set("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true")
env.set("DOTNET_CLI_TELEMETRY_OPTOUT", "true")
env.set("JB_SPACE_PUBLIC_NUGET_URL", Params("spacedotnet_public_nuget_url"))
env.set("JB_SPACE_PUBLIC_CLIENT_TOKEN", Secrets("spacedotnet_public_nuget_apikey"))
shellScript {
content = buildScript
}
}
}
job("Build and publish to NuGet.org (manual)") {
startOn {
gitPush { enabled = false } // disable the default gitPush trigger
}
container("Initiate Space deployment", image = "openjdk:11") {
resources {
cpu = 0.5.cpu
memory = 512.mb
}
kotlinScript { api ->
api.space().projects.automation.deployments.start(
project = api.projectIdentifier(),
targetIdentifier = TargetIdentifier.Key("nuget"),
version = api.executionNumber().toString(),
syncWithAutomationJob = true
)
}
}
container(buildContainerImage) {
resources {
cpu = 2.cpu
memory = 4.gb
}
env.set("DOTNET_NOLOGO", "true")
env.set("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true")
env.set("DOTNET_CLI_TELEMETRY_OPTOUT", "true")
env.set("JB_SPACE_PUBLIC_NUGET_URL", Params("spacedotnet_public_nuget_url"))
env.set("JB_SPACE_PUBLIC_CLIENT_TOKEN", Secrets("spacedotnet_public_nuget_apikey"))
env.set("JB_SPACE_NUGETORG_NUGET_URL", Params("spacedotnet_nugetorg_nuget_url"))
env.set("JB_SPACE_NUGETORG_CLIENT_TOKEN", Secrets("spacedotnet_nugetorg_nuget_apikey"))
shellScript {
content = buildScript
}
}
}
job("Remote development images") {
startOn {
gitPush {
enabled = true
branchFilter {
+"refs/heads/main"
-"refs/merge/*"
-"refs/pull/*"
}
pathFilter {
+".space/*.devfile.yml"
+".space/Dockerfile"
}
}
}
host {
dockerBuildPush {
context = "."
file = ".space/Dockerfile"
labels["vendor"] = "JetBrains"
tags {
+"registry.jetbrains.team/p/evan/dev-environments/spacedotnet:latest"
}
}
}
}