These are chat archives for ewilde/crane

2nd
Jul 2015
David Laing
@mrdavidlaing
Jul 02 2015 14:09

@ewilde After manually creating my .nuspec file, I discovered that you can trigger a Nuget publish using:

build.ps1
build.ps1 -nuget_api_key 76b0XXXXX NugetPublish

However, it seems that it is using the incorrect -Source setting, failing with

psake version 4.4.0
Copyright (c) 2010-2014 James Kovacs & Contributors

-------------------------[SetupContext]-------------------------


sln_file_info       : C:\dev\log4net.Appenders.Contrib\src\log4net.Appenders.Contrib.sln
solution_context    : Crane.Core.Api.SolutionContext
chocolatey_api_key  :
configuration       : Debug
nuget_api_url       : https://www.nuget.org/api/v2/
nuget_api_key       : 76b040c7XXXX
nuget_file          :
build_version       : 2.0.0.0
build_dir           : C:\dev\log4net.Appenders.Contrib\build
verbose             :
packages_folder     : C:\dev\log4net.Appenders.Contrib\src\packages
nuget_artifacts_dir : C:\dev\log4net.Appenders.Contrib\build-output\nuget
root_dir            : C:\dev\log4net.Appenders.Contrib
teamcity_build      : False
build_artifacts_dir : C:\dev\log4net.Appenders.Contrib\build-output
is_git_repo         : True
chocolatey_api_url  :

-------------------------[NugetExists]-------------------------
-------------------------[NugetPack]-------------------------
Attempting to build package from 'log4net.Appenders.Contrib.nuspec'.
Successfully created package 'C:\dev\log4net.Appenders.Contrib\build-output\nuget\log4net.Appenders.Contrib.2.0.0.0.nup
kg'.


-------------------------[NugetPublish]-------------------------
Error: 02/07/2015 15:06:12:
At C:\dev\log4net.Appenders.Contrib\build\modules\nugettasks.psm1:21 char:5 +     Invoke-CraneNugetPublishAllProjects $
global:context.solution_context -NugetO ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~ [<<==>>] Exception: Error executing nuget push for project log4net.Appenders.Contrib.Command: C:\dev\log4net.Ap
penders.Contrib\build\NuGet.exe push "C:\dev\log4net.Appenders.Contrib\build-output\nuget\log4net.Appenders.Contrib.2.0
.0.0.nupkg" -Source https://www.nuget.org/api/v2/ -ApiKey 76b040c7XXX, StandardOutput: Pushing
 log4net.Appenders.Contrib 2.0.0.0 to 'https://www.nuget.org/api/v2/'..., ErrorOutput: Failed to process request. 'Meth
od Not Allowed'. The remote server returned an error: (405) Method Not Allowed.., ExitCode: 1

I think that the correct NuGet -Source is:

https://www.nuget.org/api/v2/package

Is this a bug, or a problem with the way I’m invoking the NugetPublish target?

Edward Wilde
@ewilde
Jul 02 2015 14:10
can you try changing the source to https://www.nuget.org
or passing in source as https://www.nuget.org
David Laing
@mrdavidlaing
Jul 02 2015 14:12
This seems to work
PS C:\dev\log4net.Appenders.Contrib> .\build.ps1 -nuget_api_key 76b040c7XXX -nuget_api_url http
s://www.nuget.org/api/v2/package NugetPublish

psake version 4.4.0
Copyright (c) 2010-2014 James Kovacs & Contributors

-------------------------[SetupContext]-------------------------


sln_file_info       : C:\dev\log4net.Appenders.Contrib\src\log4net.Appenders.Contrib.sln
solution_context    : Crane.Core.Api.SolutionContext
chocolatey_api_key  :
configuration       : Debug
nuget_api_url       : https://www.nuget.org/api/v2/package
nuget_api_key       : 76b040c7XXXXX
nuget_file          :
build_version       : 2.0.1.0
build_dir           : C:\dev\log4net.Appenders.Contrib\build
verbose             :
packages_folder     : C:\dev\log4net.Appenders.Contrib\src\packages
nuget_artifacts_dir : C:\dev\log4net.Appenders.Contrib\build-output\nuget
root_dir            : C:\dev\log4net.Appenders.Contrib
teamcity_build      : False
build_artifacts_dir : C:\dev\log4net.Appenders.Contrib\build-output
is_git_repo         : True
chocolatey_api_url  :

-------------------------[NugetExists]-------------------------
-------------------------[NugetPack]-------------------------
Attempting to build package from 'log4net.Appenders.Contrib.nuspec'.
Successfully created package 'C:\dev\log4net.Appenders.Contrib\build-output\nuget\log4net.Appenders.Contrib.2.0.1.0.nup
kg'.


-------------------------[NugetPublish]-------------------------
Pushing log4net.Appenders.Contrib 2.0.1.0 to 'https://www.nuget.org/api/v2/package'...
Your package was pushed.



Build Succeeded!

----------------------------------------------------------------------
Build Time Report
----------------------------------------------------------------------
Name         Duration
----         --------
SetupContext 00:00:00.0196846
NugetExists  00:00:00.0020109
NugetPack    00:00:00.3147637
NugetPublish 00:01:06.3255324
Total:       00:01:06.6869157
Edward Wilde
@ewilde
Jul 02 2015 14:13
did it work with the source just as https://www.nuget.org ?
David Laing
@mrdavidlaing
Jul 02 2015 14:13
PS C:\dev\log4net.Appenders.Contrib> .\build.ps1 -nuget_api_key 76b040c7-XXX -nuget_api_url http
s://www.nuget.org NugetPublish
Appears to work too
Edward Wilde
@ewilde
Jul 02 2015 14:14
looks like a bug with the default in crane
yeah that should be the correct way to do it
nuget is wierd sometime you have to pass /api/v2 in the source other times it doesn't want it!!!!
David Laing
@mrdavidlaing
Jul 02 2015 14:14
Yeah!
Should I raise a bug against crane?
Edward Wilde
@ewilde
Jul 02 2015 14:15
yes please :)
David Laing
@mrdavidlaing
Jul 02 2015 14:26
@ewilde Here you go: #106