renevanosnabrugge / vsts-promotepackage-task

Promote a package in VSTS to a Release View
MIT License
21 stars 25 forks source link

Please provide documentation for use with yaml pipelines #44

Open DavidJFowler opened 4 years ago

DavidJFowler commented 4 years ago

Hi,

Would it be possible to document how to use this task in a yaml pipeline?

Thanks.

renevanosnabrugge commented 4 years ago

Currently it uses the Id's of the release views/ packages and feeds. Easiest way now, is to create a designer pipeline, add the task, put in the settings, and then view the YAML and copy it.. The task cannot process the names and convert it to ID's yet..

Looks something like this

steps:
- task: rvo.vsts-promotepackage-task.vsts-promotepackage-task.rvo-vsts-promotepackage-task@1
  displayName: 'Promote package to Release View'
  inputs:
    feed: '66487500-538f-40fe-ac83-6a4789e669b1'
    definition: '338e2210-c4cb-4128-bf7c-6a8114a98a47'
    version: 1.2.0
    releaseView: '0ef59186-c5e9-40ac-8abc-911edabcbb1e'
DavidJFowler commented 4 years ago

The task cannot process the names and convert it to ID's yet..

Hi,

Thanks @renevanosnabrugge for your reply. It does seem that the task can process names in some circumstances. This works for me:

- task: rvo.vsts-promotepackage-task.vsts-promotepackage-task.rvo-vsts-promotepackage-task@3
  displayName: 'Promote package to Release View'
  inputs:
    feed:  MyNuget
    releaseView: PreRelease
    inputType: nameVersion
    packageIds: $(PackageName)
    version: $(PreReleaseVersion)
demoran23 commented 3 years ago

I had some success with YAML pipelines, after a fair amount of trial and error. Here's what I used:

      - task: rvo.vsts-promotepackage-task.vsts-promotepackage-task.rvo-vsts-promotepackage-task@3
        displayName: 'Promote package'
        inputs:
          feed: <my organization feed name, same value as publishVstsFeed in NuGetCommand@2 push>
          releaseView: ${{ parameters.artifactView }}
          inputType: packageFiles
          packageIds: <my package name>
          packagesDirectory: $(Build.ArtifactStagingDirectory)