developer9969
developer9969

Reputation: 5236

sync postman with azure devops

I can succesfully run postman tests in azure devops is there a way to

  1. Create a Repo "MyCollection"
  2. Run a "Cron" pipeline that takes the collection and saves it to the repo?

any suggestions

Upvotes: 0

Views: 1243

Answers (1)

Vito Liu
Vito Liu

Reputation: 8298

Check this extension Get Postman Scripts, by default it will download your postman json file and save it to $(Build.ArtifactStagingDirectory), then we could push the files to Azure DevOps repo via git cmd.

cd  $(Build.ArtifactStagingDirectory)
git config --global user.name "{email}"
git checkout master
git add .
git commit -m "Sync postman json file to Azure DevOps Repo"
git push https://{PAT}@dev.azure.com/{org name}/{project name}/_git/{repo name}

You could also check this doc for more details.

Update1

YAML

- task: oneLuckiGetPostmanScripts@1
  displayName: 'Get Postman Script'
  inputs:
    fileLocation: '$(Build.ArtifactStagingDirectory)\Postman'
    apiKey: '{key}'

Result:

enter image description here

Upvotes: 2

Related Questions