forked from gusztavvargadr/packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
218 lines (194 loc) · 4.81 KB
/
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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#load "src/core/cake/core.cake"
var target = Argument("target", "default");
var configuration = Argument("configuration", string.Empty);
var version = "2012";
var buildDirectory = Argument("build-directory", EnvironmentVariable("PACKER_BUILD_DIR") ?? "./build");
PackerTemplate.BuildDirectory = buildDirectory;
Environment.SetEnvironmentVariable("PACKER_SOURCE_DIR", MakeAbsolute(Directory(".")).ToString());
var ws2016s = PackerTemplates_CreateWindows(
"ws2016s",
"windows-server-standard",
$"1607.0.{version}"
);
var ws2019s = PackerTemplates_CreateWindows(
"ws2019s",
"windows-server-standard",
$"1809.0.{version}"
);
var ws2016sc = PackerTemplates_CreateWindows(
"ws2016sc",
"windows-server-standard-core",
$"1607.0.{version}"
);
var ws2019sc = PackerTemplates_CreateWindows(
"ws2019sc",
"windows-server-standard-core",
$"1809.0.{version}"
);
var wsips = PackerTemplates_CreateWindows(
"wsips",
"windows-server-standard-insider",
$"2009.0.{version}"
);
var wsipsc = PackerTemplates_CreateWindows(
"wsipsc",
"windows-server-standard-core-insider",
$"2009.0.{version}"
);
var w101809eltsc = PackerTemplates_CreateWindows(
"w101809eltsc",
"windows-10-enterprise-ltsc",
$"1809.0.{version}"
);
var w102004e = PackerTemplates_CreateWindows(
"w102004e",
"windows-10-enterprise",
$"2004.0.{version}"
);
var w102009e = PackerTemplates_CreateWindows(
"w102009e",
"windows-10-enterprise",
$"2009.0.{version}"
);
var w10ipe = PackerTemplates_CreateWindows(
"w10ipe",
"windows-10-enterprise-insider",
$"2009.0.{version}"
);
var u1604s = PackerTemplates_CreateLinux(
"u1604s",
"ubuntu-server-lts",
$"1604.0.{version}"
);
var u1604d = PackerTemplates_CreateLinux(
"u1604d",
"ubuntu-desktop-xfce-lts",
$"1604.0.{version}"
);
var ws2019s_de = PackerTemplates_CreateWindows(
"ws2019s-de",
"docker-windows-enterprise-windows-server",
$"1903.1809.{version}",
ws2019s
);
var ws2019sc_de = PackerTemplates_CreateWindows(
"ws2019sc-de",
"docker-windows-enterprise-windows-server-core",
$"1903.1809.{version}",
ws2019sc
);
var dc_w10 = PackerTemplates_CreateWindows(
"w102009e-dc",
"docker-linux-community-windows-10",
$"2010.2009.{version}",
w102009e
);
var u1604s_dc = PackerTemplates_CreateLinux(
"u1604s-dc",
"docker-linux-community-ubuntu-server",
$"2010.1604.{version}",
u1604s
);
var u1604d_dc = PackerTemplates_CreateLinux(
"u1604d-dc",
"docker-linux-community-ubuntu-desktop",
$"2010.1604.{version}",
u1604d
);
var ws2019s_iis = PackerTemplates_CreateWindows(
"ws2019s-iis",
"iis-windows-server",
$"10.1809.{version}",
ws2019s
);
var ws2019sc_iis = PackerTemplates_CreateWindows(
"ws2019sc-iis",
"iis-windows-server-core",
$"10.1809.{version}",
ws2019sc
);
var ws2019s_sql17d = PackerTemplates_CreateWindows(
"ws2019s-sql17d",
"sql-server-developer-windows-server",
$"2017.1809.{version}",
ws2019s
);
var ws2019s_sql19d = PackerTemplates_CreateWindows(
"ws2019s-sql19d",
"sql-server-developer-windows-server",
$"2019.1809.{version}",
ws2019s
);
var vs17c_w10 = PackerTemplates_CreateWindows(
"w102009e-dc-vs17c",
"visual-studio-community-windows-10",
$"2017.2009.{version}",
dc_w10
);
var vs19c_w10 = PackerTemplates_CreateWindows(
"w102009e-dc-vs19c",
"visual-studio-community-windows-10",
$"2019.2009.{version}",
dc_w10
);
var vs17p_w10 = PackerTemplates_CreateWindows(
"w102009e-dc-vs17p",
"visual-studio-professional-windows-10",
$"2017.2009.{version}",
dc_w10
);
var vs19p_w10 = PackerTemplates_CreateWindows(
"w102009e-dc-vs19p",
"visual-studio-professional-windows-10",
$"2019.2009.{version}",
dc_w10
);
Task("default")
.IsDependentOn("info");
Task("info")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Info);
});
Task("version")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Version);
});
Task("restore")
.IsDependentOn("version")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Restore);
});
Task("build")
.IsDependentOn("restore")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Build);
});
Task("rebuild")
.IsDependentOn("clean")
.IsDependentOn("build")
.Does(() => {
});
Task("test")
.IsDependentOn("build")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Test);
});
Task("package")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Package);
});
Task("publish")
.IsDependentOn("package")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Publish);
});
Task("download")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Download);
});
Task("clean")
.IsDependentOn("version")
.Does(() => {
PackerTemplates_ForEach(configuration, PackerTemplate_Clean);
});
RunTarget(target);