Skip to content

Bunch of build/deployment script fixes #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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