Hi. I'm new to dagger, but i have managed to create a function, that builds and uploads a container from a dockerfile.
My question is, what is the best way to update my deployment.yaml with that new container name and version, and maybe even upload it to git ?
I found this, but i have a hard time getting it working, and i'm not sure it's the best way ?
https://daggerverse.dev/mod/github.com/matipan/daggerverse/image-updater@c3e082566aa7dc6f14de00d1241fceee8798bf3a
Btw. I'm doing everything in python.
My current code
from typing import Annotated
import dagger
from dagger import Doc, dag, function, object_type
@object_type
class App:
@function
def build(
self,
src: Annotated[
dagger.Directory,
Doc("location of directory containing Dockerfile"),
],
) -> str:
"""Build and publish image from existing Dockerfile"""
ref = (
dag.container()
.with_directory("/src", src)
.with_workdir("/src")
.directory("/src")
.docker_build() # build from Dockerfile
.publish("ttl.sh/my-shiny-app")
)
return ref