Skip to content

Commit

Permalink
Merge pull request #949 from JakeGinnivan/BuildScriptFixes
Browse files Browse the repository at this point in the history
Bunch of build/deployment script fixes
  • Loading branch information
JakeGinnivan authored Jul 17, 2016
2 parents 088835c + c6fe1df commit 55212eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Task("Upload-AppVeyor-Artifacts")
"NuGetCommandLineBuild:GitVersion.CommandLine." + nugetVersion +".nupkg",
"NuGetRefBuild:GitVersion." + nugetVersion +".nupkg",
"NuGetTaskBuild:GitVersionTask." + nugetVersion +".nupkg",
"GitVersionTfsTaskBuild:gittools.gitversion." + semVersion +".vsix",
"GitVersionTfsTaskBuild:gittools.gitversion-" + semVersion +".vsix",
"GemBuild:" + gem,
"zip:GitVersion_" + nugetVersion + ".zip",
"releaseNotes:releasenotes.md"
Expand Down
19 changes: 12 additions & 7 deletions deploy.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#addin "Cake.Json"

var target = Argument("target", "Deploy");

using System.Net;
using System.Linq;
using System.Collections.Generic;
Expand Down Expand Up @@ -35,6 +37,7 @@ Task("EnsureRequirements")

var tag = "";
Dictionary<string, string> artifactLookup = null;
var publishingError = false;
Task("UpdateVersionInfo")
.IsDependentOn("EnsureRequirements")
.Does(() =>
Expand Down Expand Up @@ -67,7 +70,7 @@ Task("Publish-NuGetPackage")
.Does(() =>
{
NuGetPush(
"./releaseArtifacts/" + artifactLookup["NuGetExeBuild"],
"./releaseArtifacts/" + artifactLookup["NuGetRefBuild"],
new NuGetPushSettings {
ApiKey = EnvironmentVariable("NuGetApiKey"),
Source = "https://www.nuget.org/api/v2/package"
Expand Down Expand Up @@ -135,9 +138,9 @@ Task("Publish-Gem")
.IsDependentOn("DownloadGitHubReleaseArtifacts")
.Does(() =>
{
var returnCode = StartProcess("gem", new ProcessSettings
var returnCode = StartProcess("cmd", new ProcessSettings
{
Arguments = "push ./releaseArtifacts/" + artifactLookup["NuGetExeBuild"] + " --key " + EnvironmentVariable("GemApiKey")
Arguments = " /c gem push ./releaseArtifacts/" + artifactLookup["GemBuild"] + " --key " + EnvironmentVariable("GemApiKey") + " && exit 0 || exit 1"
});
if (returnCode != 0) {
Expand All @@ -151,9 +154,9 @@ Task("Publish-VstsTask")
.IsDependentOn("DownloadGitHubReleaseArtifacts")
.Does(() =>
{
var returnCode = StartProcess("tfx", new ProcessSettings
var returnCode = StartProcess("cmd", new ProcessSettings
{
Arguments = "extension publish --vsix ./releaseArtifacts/" + artifactLookup["GitVersionTfsTaskBuild"] + " --no-prompt --auth-type pat --token " + EnvironmentVariable("GemApiKey")
Arguments = " /c tfx extension publish --vsix ./releaseArtifacts/" + artifactLookup["GitVersionTfsTaskBuild"] + " --no-prompt --auth-type pat --token " + EnvironmentVariable("MarketplaceApiKey") + " && exit 0 || exit 1"
});
if (returnCode != 0) {
Expand All @@ -167,12 +170,14 @@ Task("Deploy")
.IsDependentOn("Publish-NuGetCommandLine")
.IsDependentOn("Publish-MsBuildTask")
.IsDependentOn("Publish-Chocolatey")
.IsDependentOn("Publish-Gem")
// .IsDependentOn("Publish-Gem")
.IsDependentOn("Publish-VstsTask")
.Finally(() =>
{
if(publishingError)
{
throw new Exception("An error occurred during the publishing of Cake. All publishing tasks have been attempted.");
}
});
});

RunTarget(target);
2 changes: 1 addition & 1 deletion deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ http://cakebuild.net
[CmdletBinding()]
Param(
[string]$Script = "deploy.cake",
[string]$Target = "Default",
[string]$Target = "Deploy",
[string]$Configuration = "Release",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
Expand Down

0 comments on commit 55212eb

Please sign in to comment.