Azure-pipelines-tasks: dotnet nuget push "SkipDuplicate" option for org feed

Created on 22 Mar 2020  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Required Information

Type: Feature
Enter Task Name: DotNetCoreCLI

Issue Description

When using the DotNetCoreCLI task, command "nuget push", it is not possible to specify "SkipDuplicates". This option does seem to exist on the cli itself and in the Nuget task.

dotnetcorecli

nuget

In YAML terms:

steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet push'
  inputs:
    command: push
    packagesToPush: '$(System.DefaultWorkingDirectory)/_testpackage/drop/**/*.nupkg'
    publishVstsFeed: 'testfeedguid'

- task: NuGetCommand@2
  displayName: 'NuGet push'
  inputs:
    command: push
    publishVstsFeed: 'testfeedguid'
    allowPackageConflicts: true
Release enhancement

Most helpful comment

Thanks for the feedback.
Seems this means we should abandon any tasks all together and go back to scripting...

All 5 comments

@bishal-pdMSFT @pulkitaggarwl Shall we add this to our backlog?

Gentle /ping on this issue @vineetmimrot @bishal-pdMSFT @pulkitaggarwl @damccorm . Happy to submit a PR if that helps.

The PR is open, I'm happy to suggest the change in the documentation once and if it gets merged and deployed. Thank you.

I have discussed this with the team and we have decided not to add this functionality to the task. Instead of using these "bulkier" tasks we now recommend using the NuGet Authenticate task to authenticate to Azure DevOps Artifacts feeds and to use a script task with nuget/dotnet to use the parameters you need.

- task: NuGetAuthenticate@0
- task: UseDotNet@2 # Optional if the .NET Core SDK is already installed
- script: dotnet restore
# ...
- script: dotnet nuget push --api-key AzureArtifacts --skip-duplicate --source https://pkgs.dev.azure.com/{organization}/{project?}/_packaging/{feed1}/nuget/v3/index.json MyProject.*.nupkg 

The reason for this is that the NuGet/Dotnet clients are actively being developed and new parameters and functionality are being added often. To keep up with all of the updates causes a lot of extra support for these bulky tasks. Please use example above to set up your pipeline with the '--skip-duplicate' parameter. Thank you for understanding.

Thanks for the feedback.
Seems this means we should abandon any tasks all together and go back to scripting...

Was this page helpful?
0 / 5 - 0 ratings