Skip to content

Commit

Permalink
Fix the bug introduced to image_tag (#137)
Browse files Browse the repository at this point in the history
Not sure how I missed this, but I had excluded the pipe to file. Was
able to test pushing locally in orion and it works now.
  • Loading branch information
john-michaelburke authored Jun 28, 2024
1 parent 9101183 commit dff371e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions image/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def image_tag(name, tag, extra_tags = []):
native.genrule(
name = name,
outs = ["{}.txt".format(name)],
cmd = "echo {} && echo {} > $@".format(tag, "\n".join(extra_tags)),
cmd = "echo {} > $@ && echo {} >> $@".format(tag, "\n".join(extra_tags)),
tags = ["manual"],
)

Expand All @@ -55,10 +55,11 @@ def image_stamp_tag(name, var, extra_tags = []):
name = name,
outs = ["{}.txt".format(name)],
# `(?<=A)B` in regex is a positive lookbehind - finds expression B that's preceded with A
cmd = "cat bazel-out/stable-status.txt | grep -Po '(?<={}\\s).*' && echo {} > $@".format(
cmd = (
"cat bazel-out/stable-status.txt | grep -Po '(?<={}\\s).*' > $@ && echo {} >> $@".format(
var,
"\n".join(extra_tags),
),
)),
stamp = True,
tags = ["manual"],
)

0 comments on commit dff371e

Please sign in to comment.