Skip to content

Commit 9ab2f3d

Browse files
author
Jake Ginnivan
committed
And update deploy.cake
1 parent bad1a2e commit 9ab2f3d

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

deploy.cake

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ Task("DownloadGitHubReleaseArtifacts")
8080
// Have had missing artifacts before, lets fail early in that scenario
8181
if (!artifactLookup.ContainsKey("NuGetRefBuild")) { throw new Exception("NuGetRefBuild artifact missing"); }
8282
if (!artifactLookup.ContainsKey("NuGetCommandLineBuild")) { throw new Exception("NuGetCommandLineBuild artifact missing"); }
83-
if (!artifactLookup.ContainsKey("NuGetExeDotNetCoreBuild")) { throw new Exception("NuGetExeDotNetCoreBuild artifact missing"); }
83+
if (!artifactLookup.ContainsKey("NuGetExeDotNetCoreBuild")) { throw new Exception("NuGetExeDotNetCoreBuild artifact missing"); }
8484
if (!artifactLookup.ContainsKey("NuGetTaskBuild")) { throw new Exception("NuGetTaskBuild artifact missing"); }
8585
if (!artifactLookup.ContainsKey("NuGetExeBuild")) { throw new Exception("NuGetExeBuild artifact missing"); }
8686
if (!artifactLookup.ContainsKey("GemBuild")) { throw new Exception("GemBuild artifact missing"); }
8787
if (!artifactLookup.ContainsKey("GitVersionTfsTaskBuild")) { throw new Exception("GitVersionTfsTaskBuild artifact missing"); }
8888
if (!artifactLookup.ContainsKey("zip")) { throw new Exception("zip artifact missing"); }
89-
if (!artifactLookup.ContainsKey("zip-dotnetcore")) { throw new Exception("zip-dotnetcore artifact missing"); }
89+
if (!artifactLookup.ContainsKey("zip-dotnetcore")) { throw new Exception("zip-dotnetcore artifact missing"); }
9090
});
9191

9292
Task("Publish-NuGetPackage")
@@ -206,42 +206,42 @@ Task("Publish-VstsTask")
206206
}
207207
});
208208

209-
// PublishDocker("gittools/gitversion", tag, "content.zip", "/some/path/DockerFile");
209+
// PublishDocker("gittools/gitversion", tag, "content.zip", "/some/path/DockerFile");
210210
bool PublishDocker(string name, tagName, contentZip, dockerFilePath, containerVolume)
211211
{
212212
Information("Starting Docker Build for Image: " + name);
213213

214214
var username = EnvironmentVariable("DOCKER_USERNAME");
215215
var password = EnvironmentVariable("DOCKER_PASSWORD");
216216

217-
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
217+
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
218218
{
219219
Warning("Skipping docker publish due to missing credentials");
220220
return false;
221221
}
222222

223-
// copy the docker file to a build directory, along with the contents of the specified content.zip.
224-
// This directory should then contain all we need for the docker build.
225-
var dockerBuildFolder = "./build/Docker/";
226-
CreateDirectory(dockerBuildFolder);
223+
// copy the docker file to a build directory, along with the contents of the specified content.zip.
224+
// This directory should then contain all we need for the docker build.
225+
var dockerBuildFolder = "./build/Docker/";
226+
CreateDirectory(dockerBuildFolder);
227227

228-
//var folderName = name.Replace("/", "-");
229-
var dockerFileBuildFolder = dockerBuildFolder + name;
230-
CreateDirectory(dockerFileBuildFolder);
231-
232-
Information("Copying docker file to " + dockerFileBuildFolder);
233-
CopyFiles(dockerFilePath, dockerFileBuildFolder);
228+
//var folderName = name.Replace("/", "-");
229+
var dockerFileBuildFolder = dockerBuildFolder + name;
230+
CreateDirectory(dockerFileBuildFolder);
234231

235-
var contentPath = "/content";
236-
var contentFolder = dockerFileBuildFolder + contentPath;
232+
Information("Copying docker file to " + dockerFileBuildFolder);
233+
CopyFiles(dockerFilePath, dockerFileBuildFolder);
237234

238-
Information("Extracting docker image content to " + contentFolder);
239-
Unzip(contentZip, contentFolder);
235+
var contentPath = "/content";
236+
var contentFolder = dockerFileBuildFolder + contentPath;
240237

241-
var dockerFilePathForBuild = dockerFileBuildFolder + "/DockerFile";
242-
Information("Beginning Docker Build command for " + dockerFilePathForBuild);
238+
Information("Extracting docker image content to " + contentFolder);
239+
Unzip(contentZip, contentFolder);
243240

244-
var returnCode = StartProcess("docker", new ProcessSettings
241+
var dockerFilePathForBuild = dockerFileBuildFolder + "/DockerFile";
242+
Information("Beginning Docker Build command for " + dockerFilePathForBuild);
243+
244+
var returnCode = StartProcess("docker", new ProcessSettings
245245
{
246246
Arguments = "build -f " + dockerFilePathForBuild + " " + dockerFileBuildFolder + " --build-arg contentFolder=" + contentPath + " --tag " + name + ":" + tagName
247247
});
@@ -292,7 +292,7 @@ bool PublishDocker(string name, tagName, contentZip, dockerFilePath, containerVo
292292
});
293293
if (returnCode != 0) {
294294
Information("Publish-DockerImage Task failed latest tag, but continuing with next Task...");
295-
publishingError = true;
295+
publishingError = true;
296296
}
297297

298298
returnCode = StartProcess("docker", new ProcessSettings
@@ -302,17 +302,17 @@ bool PublishDocker(string name, tagName, contentZip, dockerFilePath, containerVo
302302
if (returnCode != 0) {
303303
Information("Publish-DockerImage Task failed latest tag, but continuing with next Task...");
304304
publishingError = true;
305-
return false;
305+
return false;
306306
}
307307

308308
}
309309

310310
Task("Publish-DockerImage")
311311
.IsDependentOn("DownloadGitHubReleaseArtifacts")
312312
.Does(() =>
313-
{
314-
PublishDocker("gittools/gitversion", tag, artifactLookup["zip"], "src/Docker/Mono/DockerFile", "/repo");
315-
PublishDocker("gittools/gitversion-dotnetcore", tag, artifactLookup["zip-dotnetcore"], "src/Docker/DotNetCore/DockerFile", "c:/repo");
313+
{
314+
PublishDocker("gittools/gitversion", tag, artifactLookup["zip"], "src/Docker/Mono/DockerFile", "/repo");
315+
PublishDocker("gittools/gitversion-dotnetcore", tag, artifactLookup["zip-dotnetcore"], "src/Docker/DotNetCore/DockerFile", "c:/repo");
316316
});
317317

318318

@@ -332,4 +332,4 @@ Task("Deploy")
332332
}
333333
});
334334

335-
RunTarget(target);
335+
RunTarget(target);

0 commit comments

Comments
 (0)