Skip to main content

Azure Pipelines

The following code sample demonstrates how to integrate Dagger with Azure Pipelines.

azure-pipelines.yml
trigger:
- master

pool:
name: 'Default'
vmImage: ubuntu-latest

steps:
- script: curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
displayName: 'Install Dagger CLI'
# assumes a Go project
# modify to use different function(s) as needed
- script: dagger -m github.com/kpenfound/dagger-modules/golang@v0.1.5 call build --project=. --args=.
displayName: 'Call Dagger Function'
env:
# assumes the Dagger Cloud token is
# in a secret named DAGGER_CLOUD_TOKEN
# set via the Azure Pipeline settings UI/CLI
# the secret is then explicitly mapped to the script env
DAGGER_CLOUD_TOKEN: $(DAGGER_CLOUD_TOKEN)