Nuget push shows "PRIVATEKEY" instead of actual key on build -< fails build

Andrea's Avatar

Andrea

19 Dec, 2014 08:45 PM

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

  1. Support Staff 1 Posted by Feodor Fitsner on 19 Dec, 2014 09:02 PM

    Feodor Fitsner's Avatar

    Hi Andrea,

    Could you please point me to the place where you push nuget packages to MyGet?

  2. 2 Posted by Roundcrisis on 19 Dec, 2014 09:05 PM

    Roundcrisis's Avatar
  3. Support Staff 3 Posted by Feodor Fitsner on 19 Dec, 2014 09:15 PM

    Feodor Fitsner's Avatar

    I meant the place in the build script where you call nuget push. Thanks.

  4. 4 Posted by Andrea on 19 Dec, 2014 09:18 PM

    Andrea's Avatar

    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

  5. Support Staff 5 Posted by Feodor Fitsner on 19 Dec, 2014 09:25 PM

    Feodor Fitsner's Avatar

    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. 6 Posted by Andrea on 19 Dec, 2014 09:29 PM

    Andrea's Avatar

    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?

  7. Support Staff 7 Posted by Feodor Fitsner on 19 Dec, 2014 09:37 PM

    Feodor Fitsner's Avatar

    Thanks. So, where that PRIVATEKEY value sits? You specified nugetkey=PRIVATEKEY under Environment variables in project settings?

  8. 8 Posted by Andrea on 22 Dec, 2014 11:06 AM

    Andrea's Avatar

    well, no, I used the actual key

  9. Support Staff 9 Posted by Feodor Fitsner on 22 Dec, 2014 03:43 PM

    Feodor Fitsner's Avatar

    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.

  10. Support Staff 10 Posted by Feodor Fitsner on 22 Dec, 2014 03:48 PM

    Feodor Fitsner's Avatar
  11. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:52 AM.

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

Recent Discussions

13 Apr, 2024 04:43 PM
12 Apr, 2024 04:56 PM
11 Apr, 2024 11:16 PM
09 Apr, 2024 10:59 PM
08 Apr, 2024 07:50 AM

 

06 Apr, 2024 04:06 AM
05 Apr, 2024 01:26 PM
05 Apr, 2024 10:39 AM
04 Apr, 2024 03:41 PM
31 Mar, 2024 05:51 PM
30 Mar, 2024 01:59 PM