Skip to content

Instantly share code, notes, and snippets.

@rockyburt
Created May 30, 2022 01:54
Show Gist options
  • Save rockyburt/f4c780797d1bd259a7a210a91821e8ca to your computer and use it in GitHub Desktop.
Save rockyburt/f4c780797d1bd259a7a210a91821e8ca to your computer and use it in GitHub Desktop.
package rentalsapi
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
"universe.dagger.io/docker/cli"
)
client: filesystem: ".": read: contents: dagger.#FS
client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket
#PythonImageBuild: {
pyVersion: string
tag: string
dockerfile: *{
path: string | *"Dockerfile"
} | {
contents: string
}
_build: docker.#Dockerfile & {
source: client.filesystem.".".read.contents
"dockerfile": dockerfile
buildArg: "PYTHON_EXACT_VERSION": pyVersion
}
_load: cli.#Load & {
image: _build.output
host: client.network."unix:///var/run/docker.sock".connect
"tag": tag
}
output: _build.output
}
dagger.#Plan & {
_base: core.#Source & {
path: "."
}
actions: {
makeBuilder: #PythonImageBuild & {
pyVersion: "3.11-rc"
dockerfile: path: "Dockerfile.build"
tag: "519507978765.dkr.ecr.ca-central-1.amazonaws.com/rentals/api:build-py3.11-rc"
}
buildWheels: docker.#Run & {
input: makeBuilder.output
mounts: project: {
dest: "/rentals/api/src/Rentals-API"
contents: _base.output
}
always: true
workdir: "/rentals/api/src/Rentals-API"
command: {
name: "sh"
args: ["-c", "mkdir -p .build && poetry export --dev --without-hashes --format=requirements.txt > .build/requirements.txt && ls -al"]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment