Skip to content

Instantly share code, notes, and snippets.

@brk3
Last active April 12, 2022 11:46
Show Gist options
  • Save brk3/3d2c522588fe55a0aa0dcd6ffe24a350 to your computer and use it in GitHub Desktop.
Save brk3/3d2c522588fe55a0aa0dcd6ffe24a350 to your computer and use it in GitHub Desktop.
package hello
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: env: GITHUB_PAT: dagger.#Secret
actions: {
rover: {
rover: docker.#Pull & {
source: "aztfmod/rover:1.1.6-2202.2503"
}
azurecache: "/home/vscode/.azure": {
dest: "/home/vscode/.azure/"
type: "cache"
contents: core.#CacheDir & {
id: "azurecache"
}
}
foo1: docker.#Run & {
input: rover.image
command: name: "sudo"
command: args: [
"chown",
"vscode:docker",
"/home/vscode/.azure"
]
mounts: azurecache
always: true
}
// /home/vscode/.azure is still root:root, so we can't write to it, 'az login' will fail
foo2: docker.#Run & {
input: rover.image
command: name: "ls"
command: args: [
"-lrta",
"/home/vscode/",
]
env: DEP: "\(foo1.success)"
mounts: azurecache
always: true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment