Triggering azure pipelines from any [Docker enabled] CI provider
This will most likely be useful to you if you're planning to trigger azure pipelines from an external CI. In my case, this was using Gitlab's CI.
The syntax to launch the cli using docker is quite simple:
$ docker run xwiillz/azure-pipelines-runner azure-pipelines run {Your Azure DevOps Organization} {Your Azure DevOps Project} {Branch name from which you would like to trigger the CI} {Your Azure DevOps Personal Access Token} [-d some-definition-id] ...
$ npm install -g azure-pipelines-from-gitlab
$ azure-pipelines COMMAND
running command...
$ azure-pipelines (-v|--version|version)
azure-pipelines-from-gitlab/0.0.0 linux-x64 node-v12.13.0
$ azure-pipelines --help [COMMAND]
USAGE
$ azure-pipelines COMMAND
...
azure-pipelines help [COMMAND]
azure-pipelines run ORGANIZATION PROJECT SOURCEBRANCH PERSONALACCESSTOKEN [DEFINITIONS]
display help for azure-pipelines
USAGE
$ azure-pipelines help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
trigger one or more azure pipelines and wait for them to finish
USAGE
$ azure-pipelines run ORGANIZATION PROJECT SOURCEBRANCH PERSONALACCESSTOKEN [DEFINITIONS]
OPTIONS
-d, --definitions=definitions build definition IDs to run as an array of integer. All available pipelines will be ran
if nothing is provided
-h, --help show CLI help
EXAMPLE
$ azure-pipelines run myOrganization myProject master personalAccessToken
Queuing build with definition id "2"...
Queuing build with definition id "3"...
Queuing build with definition id "4"...
Queued build "Desktop CI (WPF)" (build id = 27). Waiting for it to finish... (polling)
Queued build "Android-CI" (build id = 28). Waiting for it to finish... (polling)
Queued build "Server CI (.NET Core)" (build id = 26). Waiting for it to finish... (polling)
Got refreshed build status for Desktop CI (WPF). CurrentStatus: inProgress
Got refreshed build status for Desktop CI (WPF). CurrentStatus: completed
Build finished with result "succeeded"
Got refreshed build status for Server CI (.NET Core). CurrentStatus: inProgress
Got refreshed build status for Server CI (.NET Core). CurrentStatus: completed
Build finished with result "failed"
Got refreshed build status for Android-CI. CurrentStatus: inProgress
Got refreshed build status for Android-CI. CurrentStatus: completed
Build finished with result "failed"
See code: src/commands/run.ts