feat(publish): example publishing to some remote registry

This commit is contained in:
Patrick Sy 2024-10-15 10:15:29 +02:00
parent 3c8e872e6e
commit e74b8cc185
Signed by: Patrick.Sy
GPG key ID: DDDC8EC51823195E
2 changed files with 40 additions and 1 deletions

View file

@ -59,6 +59,20 @@ class HelloDagger {
.withExec(["golangci-lint", "run", "-v"]);
}
@func()
async publish(source: Directory, target?: string): Promise<string> {
// publish can only push to external registries
// to publish to your local docker, you have to export the tarball and use `docker load`
// This example is somewhat useless as one could just chain `publish` to `call build`
// publish automatically picks up the local auth from the host
// otherwise, use `withRegistryAuth()`
return this.build(source).publish(
target ?? "mtr.devops.telekom.de/patrick_sy/hello-dagger:latest",
);
}
/**
* Build a ready-to-use development environment
*/