Skip to content
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

dotnet-nuget-push: does not support --config-file included in examples #4879

Open
livarcocc opened this issue Mar 23, 2017 · 7 comments
Open
Assignees
Labels
Category:SeasonOfGiving https://devblogs.microsoft.com/nuget/nuget-season-of-giving/#season-of-giving Functionality:Push Priority:2 Issues for the current backlog. Product:dotnet.exe Type:Feature

Comments

@livarcocc
Copy link

From @dmccaffery on March 23, 2017 6:49

Steps to reproduce

mkdir -p ~/test-nuget-issue
cd ~/test-nuget-issue
touch test-1.0.0.nupkg
touch nuget.config
dotnet nuget push *.nupkg --config-file nuget.config

Expected behavior

this would normally error out as the config file and package are empty files for the purposes of proving the point, but even with a valid pkg and config file, this does not work as expected as the command line parser does not support the --config-file option indicated in the example docs from:

https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-nuget-push.md#examples

Actual behavior

Specify --help for a list of available options and commands.
error: Unrecognized option '--config-file'

The command is missing from the available options in the parser:

https://github.com/dotnet/cli/blob/485237a8a0c61c17858e88b9525d29e0fb426064/src/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs#L50

The ability to set the config file is a pretty important requirement for CI systems that dump nuget credentials to a temporary file as they must appear in clear-text on non-windows platforms. The VSTS tasks do this today, for example, although they use the nuget xplat client directly:

https://github.com/Microsoft/vsts-tasks/blob/d2290c1a38f98a13af6e8e5c06430b498742c5a3/Tasks/NuGetPublisher/nugetpublisher.ts#L122

https://github.com/Microsoft/vsts-tasks/blob/d2290c1a38f98a13af6e8e5c06430b498742c5a3/Tasks/NuGetPublisher/nugetpublisher.ts#L140

https://github.com/Microsoft/vsts-tasks/blob/d2290c1a38f98a13af6e8e5c06430b498742c5a3/Tasks/NuGetPublisher/nugetpublisher.ts#L179

At any rate, if the dotnet-nuget command is forwarding arguments for everything else that the nuget client supports, it should also forward the config file argument. Someone thought of it, obviously, since its in the docs -- it just isn't supported by the dotnet-nuget command today.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /Users/dmccaffery/.dotnet/sdk/1.0.1

Copied from original issue: dotnet/cli#6123

@emgarten emgarten added this to the Backlog milestone Oct 17, 2017
@emgarten emgarten added Functionality:Push Priority:2 Issues for the current backlog. labels Oct 17, 2017
@paulness
Copy link

paulness commented May 13, 2018

There is a workaround..... This took me ages to figure out unfortunately.

Assuming you have your desired nuget.config inside /wd/ this will push everything in /nuget-artifacts/ to NuGet according to the settings in that config file

(cd /wd/ ; dotnet nuget push /nuget-artifacts/ --api-key vsts)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="DefaultPushSource" value="FILL ME OUT" />
  </config>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json"/>
    <add key="CustomFeed" value="FILL ME OUT" />
  </packageSources>
  <packageSourceCredentials>
    <CustomFeed>
      <add key="Username" value="vsts" />
      <add key="ClearTextPassword" value="FILL ME OUT" />
    </CustomFeed>
  </packageSourceCredentials>
</configuration>

@niwrA
Copy link

niwrA commented Sep 2, 2018

So considering how long this has been open, does this mean we should just use nuget to publish instead of dotnet?

@hrumhurum
Copy link

Please strongly consider to add support for --config-file option.

.NET Core SDK 2.1 is mostly in sweet condition now except a few sharp edges here and there. The absence of --config-file option for dotnet nuget command is one of those sharp edges.

Please please please. We need that option.

@Socolin
Copy link

Socolin commented Dec 16, 2020

Is there any plan for this feature ? Othersdotnet nuget command support this

@nkolev92 nkolev92 added Category:SeasonOfGiving https://devblogs.microsoft.com/nuget/nuget-season-of-giving/#season-of-giving and removed Pipeline:Backlog labels Aug 29, 2022
@nkolev92 nkolev92 removed the Category:Quality Week Issues that should be considered for quality week label Oct 3, 2022
@nkolev92 nkolev92 removed this from the Backlog milestone Nov 8, 2022
@donnie-msft donnie-msft self-assigned this Dec 6, 2022
@ahaleiii
Copy link

ahaleiii commented Sep 5, 2023

If I am able to run a dotnet restore against a custom nuget.config file, I should be able to run a dotnet nuget push against that same config file.

@DavidRadoorHummel
Copy link

Almost 7 years and no progress

@jackmtpt
Copy link

Hello Microsoft? Is anyone looking at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:SeasonOfGiving https://devblogs.microsoft.com/nuget/nuget-season-of-giving/#season-of-giving Functionality:Push Priority:2 Issues for the current backlog. Product:dotnet.exe Type:Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.