# README
Azure DevOps Pipelines trigger task
Description
Image which can be used in Azure DevOps Pipelines to trigger other pipelines.
Usage
Usage:
devops-worker pipelines trigger [flags] -- PIPELINES...
Flags:
-h, --help help for trigger
-p, --project string Name of the Azure DevOps Project
-r, --targetRefName string (Optional) Specify the GitRef on which the Pipeline should run
-v, --targetVersion string (Optional) Specify the Commit Hash on which the Pipeline should run
-w, --waitForCompletion (Optional) Specify if the task should block until the target pipeline is completed
Global Flags:
--token string Azure DevOps Personal Access Token (PAT) / Value of $(System.AccessToken)
--url string Azure DevOps Organization Url (must be https://dev.azure.com/ORG or https://ORG.visualstudio.com)
Authentication
For authentication, you can use a Personal Access Token (PAT) or the Build-In Build Service
User.
In order to use the Build Service
User, you need to manually grant the User permission to queue builds on the pipelines, then you can use as token value the value of the System.AccessToken
built-in variable. E.g. --token $(System.AccessToken)
.
Example
pool:
vmImage: 'ubuntu-latest'
container:
image: whiteduck/azure-devops-pipeline-trigger-task:2.1.3
steps:
- script: |
devops-worker pipelines trigger \
--url "$(System.CollectionUri)" \
--token "$(System.AccessToken)" \
--project "$(System.TeamProject)" \
--targetRefName "$(Build.SourceBranchName)" \
--targetVersion "$(Build.SourceVersion)" \
--waitForCompletion \
-- "My Demo Pipeline"
displayName: "Trigger 'My Demo Pipeline' pipeline"
# Packages
Copyright © 2020 Stefan Kürzeder <[email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
No description provided by the author