Skip to content

Instantly share code, notes, and snippets.

@brk3
Created April 14, 2022 09:58
Show Gist options
  • Save brk3/a3c40883635a2562397d31c4b017b27d to your computer and use it in GitHub Desktop.
Save brk3/a3c40883635a2562397d31c4b017b27d to your computer and use it in GitHub Desktop.
package main [41/1408]
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
)
dagger.#Plan & {
actions: {
rover: {
rover: docker.#Pull & {
source: "aztfmod/rover:1.1.6-2202.2503"
}
azurecache: "/root/.azure": {
dest: "/root/.azure/"
type: "cache"
contents: core.#CacheDir & {
id: "azurecache"
}
}
az_login: docker.#Run & {
input: rover.image
user: "root"
command: name: "/bin/bash"
command: args: ["-c", """
az login --service-principal -u xxx -p xxx --tenant xxx
"""]
mounts: _azurecache: {
dest: "/root/.azure/"
contents: azurecache.contents
}
always: true
}
az_account_show: docker.#Run & {
input: rover.image
user: "root"
command: name: "/bin/bash"
command: args: ["-c", """
az account show
"""]
mounts: _azurecache: {
dest: "/root/.azure"
contents: az_login.mounts._azurecache.contents
}
env: DEP: "\(az_login.success)"
always: true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment