trigger:
- master

pool:
  name: 'Azure Pipelines'
  vmImage: ubuntu-latest

steps:
- task: GoTool@0
  inputs:
    version: '1.20'
  displayName: 'Install Go'

- script: |
    go get dagger.io/dagger@latest
    go get github.com/Azure/azure-sdk-for-go/sdk/azcore
    go get github.com/Azure/azure-sdk-for-go/sdk/azidentity
    go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance/v2
  displayName: 'Install Dagger Go SDK and related'

- script: cd /usr/local && { curl -L https://dl.dagger.io/dagger/install.sh | sh; cd -; }
  displayName: 'Install Dagger CLI'

- script: dagger run go run ci/main.go
  displayName: 'Run Dagger'
  env:
    DOCKERHUB_PASSWORD: $(DOCKERHUB_PASSWORD)
    AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
