diff options
| author | Christine Dodrill <me@christine.website> | 2019-06-26 21:28:11 +0000 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-06-26 21:28:11 +0000 |
| commit | 2a73e72c2f4bec8eb53120e8881655b56966b85f (patch) | |
| tree | 65d925142bc4a51a2039b5fb29e4e6fb8acd340b | |
| parent | 153914d24f62312cdef8e52a5cf47866fa27b793 (diff) | |
| download | x-1.1.3.tar.xz x-1.1.3.zip | |
internal/yeet: fix DockerBuild, oopsv1.1.3
| -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...) } |
