diff options
| author | Christine Dodrill <me@christine.website> | 2019-06-15 17:44:13 +0000 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-06-15 17:44:13 +0000 |
| commit | d6c93f6c9ebe6efa26180d04cfeedda9ddec31c6 (patch) | |
| tree | 4cbad2b9edd37c33364ebac14cf2d7b461a5dabd /internal/yeet | |
| parent | e9968ab535959d6733af1dba3d84f186a7b9579f (diff) | |
| download | x-d6c93f6c9ebe6efa26180d04cfeedda9ddec31c6.tar.xz x-d6c93f6c9ebe6efa26180d04cfeedda9ddec31c6.zip | |
simplifications
Diffstat (limited to 'internal/yeet')
| -rw-r--r-- | internal/yeet/yeet.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/internal/yeet/yeet.go b/internal/yeet/yeet.go index d066cf0..e769cf6 100644 --- a/internal/yeet/yeet.go +++ b/internal/yeet/yeet.go @@ -45,7 +45,7 @@ func ShouldWork(ctx context.Context, env []string, dir string, cmdName string, a log.Printf("starting process, pwd: %s, cmd: %s, args: %v", dir, loc, args) err = cmd.Run() if err != nil { - log.Fatal(err) + panic(err) } } @@ -77,15 +77,21 @@ func GitTag(ctx context.Context) (string, error) { } // DockerTag tags a docker image -func DockerTag(ctx context.Context, org, repo, image string) (string, error) { +func DockerTag(ctx context.Context, org, repo, image string) string { tag, err := GitTag(ctx) if err != nil { - return "", err + panic(err) } repoTag := fmt.Sprintf("%s/%s:%s", org, repo, tag) ShouldWork(ctx, nil, WD, "docker", "tag", image, repoTag) - return repoTag, nil + return repoTag +} + +// 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...) + ShouldWork(ctx, nil, dir, "docker", args...) } |
