We're using Azure DevOps for our project. I've azure-pipelines.yml file which uses the build id to the docker image tag. But, We're looking to manually add the docker image id as part of the build definition.
Is it possible to pass the runtime arguments from build queue rest api to azure-pipelines.yml file?
azure-pipelines.yml
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
resources:
- repo: self
variables:
imageName: 'sampleapp1'
dockerhubNS: 'kumaresh'
steps:
- task: Docker@2
displayName: Login to Docker Hub
inputs:
command: login
containerRegistry: dh-connection
- task: Docker@2
displayName: Build and Push an image
inputs:
command: buildAndPush
dockerfile: Dockerfile
containerRegistry: dh-connection
repository: $(dockerhubNS)/$(imageName)
tag: $(appBuildNumber)
Request Body for Build Queue
"definition": {
"id": Build_Definition_Id,
"name": extractDefinitionName,
"type": "build"
},
"templateParameters": {
"tag": "1"
}
