Skip to content

Instantly share code, notes, and snippets.

@sblack4
Created October 7, 2019 15:40
Show Gist options
  • Save sblack4/0d2d6606dca3d83183b868266a3ce5bd to your computer and use it in GitHub Desktop.
Save sblack4/0d2d6606dca3d83183b868266a3ce5bd to your computer and use it in GitHub Desktop.
Azure Pipelines Cheatsheet
name: name_of_your_pipeline
trigger:
- master
- other_branches
pool:
vmImage: 'ubuntu-latest'
variables: # variables: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables
- group: ACR # variable group: https://docs.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups
- name: project
value: 'nonofyour'
- name: container_registry
value: 'nowayjose.azurecr.io'
- name: image_tag
value: "$(container_registry)/$(project)-`git rev-parse --short HEAD`" # you can do bash stuff like this in vars!
steps:
- task: Bash@3 # bash task: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/bash
displayName: 'Build Docker Container'
inputs:
targetType: 'inline'
script: |
# build docker container
echo "building $(tag)"
docker build \
-t "$(image_tag)" \
.
workingDirectory: $(project)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment