Nuget push shows "PRIVATEKEY" instead of actual key on build -< fails build
Hi there
I have a configuration that runs a FAKE build script that runs great locally however it fails at the last step (push to myget ) in AppVeyor, the reason seems to be that instead of using the environment variable "nugetkey" it uses PRIVATEKEY and so MyGet refuses the new package push.
It makes me think that
a) possibly I put the setting in the wrong place, if this is the case, where should I put it
b) something is wrong with EnvVariables
This is a link to my build https://ci.appveyor.com/project/batbuild/dualityogvplayerplugin
the project is open source so the build file is available here https://github.com/Andrea/DualityOgvPlayerPlugin/blob/master/completeBuild.fsx
Thanks and regards
Andrea
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 19 Dec, 2014 09:02 PM
Hi Andrea,
Could you please point me to the place where you push nuget packages to MyGet?
2 Posted by Roundcrisis on 19 Dec, 2014 09:05 PM
sure https://www.myget.org/F/6416d9912a7c4d46bc983870fb440d25/
Andrea
www.roundcrisis.com
Support Staff 3 Posted by Feodor Fitsner on 19 Dec, 2014 09:15 PM
I meant the place in the build script where you call
nuget push
. Thanks.4 Posted by Andrea on 19 Dec, 2014 09:18 PM
Oops sorry
https://github.com/Andrea/DualityOgvPlayerPlugin/blob/master/completeBuild.fsx#L59
(line 59)
Target "CreateNuget" (fun _ ->
// Copy all the package files into a package folder
NuGet (fun p ->
{p with
Version = version
Project = "OgvPlayerCorePlugin"
PublishUrl = getBuildParamOrDefault "nugetrepo" ""
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetrepo"
})
"nuget/OgvPlayerCorePlugin.nuspec"
)
the console output looks like this:
1) System.Exception: Error during NuGet push. C:\projects\dualityogvplayerplugin\packages\NuGet.Commandline\tools\nuget.exe push "C:\projects\dualityogvplayerplugin\NuGet\OgvPlayerCorePlugin.0.3.10.nupkg" PRIVATEKEY -s https://www.myget.org/F/6416d9912a7c4d46bc983870fb440d25/api/v2/package
201 at Fake.NuGetHelper.NuGet(FSharpFunc`2 setParams, String nuspecFile) in D:\code\fake\src\app\FakeLib\NuGet\NugetHelper.fs:line 356
202 at [email blocked](Unit _arg5) in C:\projects\dualityogvplayerplugin\CompleteBuild.fsx:line 62
203 at Fake.TargetHelper.runTarget@317(String targetName) in D:\code\fake\src\app\FakeLib\TargetHelper.fs:line 331
Support Staff 5 Posted by Feodor Fitsner on 19 Dec, 2014 09:25 PM
Access key in this line: https://github.com/Andrea/DualityOgvPlayerPlugin/blob/master/comple... - does it come from
nugetkey
environment variable or how that works? I'm new to FAKE, sorry.6 Posted by Andrea on 19 Dec, 2014 09:29 PM
I should have explained, sorry
So, when you do that it takes the value from the environment variables with that name, I set one for both nugetrepo and nugetkey (AFAIK) in this build's configuration
Does that make sense?
Support Staff 7 Posted by Feodor Fitsner on 19 Dec, 2014 09:37 PM
Thanks. So, where that
PRIVATEKEY
value sits? You specifiednugetkey=PRIVATEKEY
under Environment variables in project settings?8 Posted by Andrea on 22 Dec, 2014 11:06 AM
well, no, I used the actual key
Support Staff 9 Posted by Feodor Fitsner on 22 Dec, 2014 03:43 PM
Can you just echo that environment with private key to see if you get correct value ( if it's a public project do not echo real key as it will be shown in console )? See attached screenshot.
Support Staff 10 Posted by Feodor Fitsner on 22 Dec, 2014 03:48 PM
And I can do that with YAML config as well: https://github.com/FeodorFitsner/simple-console/blob/master/appveyo...
Results: https://ci.appveyor.com/project/FeodorFitsner/simple-console/build/...
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:52 AM.