diff options
| -rw-r--r-- | docker.go | 16 | ||||
| -rw-r--r-- | internal/yeet/yeet.go | 1 |
2 files changed, 13 insertions, 4 deletions
@@ -5,13 +5,19 @@ package main import ( "context" + "flag" "log" "path/filepath" "within.website/x/internal/yeet" ) +var ( + dontPush = flag.Bool("dont-push", false, "if set, don't push docker images") +) + func main() { + flag.Parse() ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -35,10 +41,12 @@ func main() { yeet.DockerBuild(ctx, filepath.Join(yeet.WD, "cmd", "h"), hTag, "--build-arg", "X_VERSION="+gitTag) - yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", resTag) - yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", otherResTag) - yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", dnsdGithubTag) - yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", hTag) + if !*dontPush { + yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", resTag) + yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", otherResTag) + yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", dnsdGithubTag) + yeet.ShouldWork(ctx, nil, yeet.WD, "docker", "push", hTag) + } log.Printf("xperimental:\t%s", otherResTag) log.Printf("dnsd:\t%s", dnsdGithubTag) diff --git a/internal/yeet/yeet.go b/internal/yeet/yeet.go index e769cf6..25ded2f 100644 --- a/internal/yeet/yeet.go +++ b/internal/yeet/yeet.go @@ -93,5 +93,6 @@ func DockerTag(ctx context.Context, org, repo, image string) string { // DockerBuild builds a docker image with the given working directory and tag. func DockerBuild(ctx context.Context, dir, tag string, args ...string) { args = append([]string{"build", "-t", tag}, args...) + args = append(args, ".") ShouldWork(ctx, nil, dir, "docker", args...) } |
