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

  1. Hi Andrea,

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

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

  3. 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

  4. 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.

  5. 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?

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

  7. well, no, I used the actual key

  8. 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.

  9. 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