Skip to content

Commit

Permalink
use correct digest output file (#42)
Browse files Browse the repository at this point in the history
* use correct digest output file

* buildifier

* shorten the tag
  • Loading branch information
kzadorozhny authored Oct 5, 2020
1 parent 8fecea8 commit 9e6d1f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/helloworld/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ k8s_deploy(
name = "canary",
cluster = CLUSTER,
deployment_branch = "helloworld-canary",
image_digest_tag = True, # test optional image tagging
image_registry = REGISTRY, # override the default registry for production
image_repository_prefix = "k8s",
images = {
Expand All @@ -87,6 +88,7 @@ k8s_deploy(
name = "release",
cluster = CLUSTER,
deployment_branch = "helloworld-prod",
image_digest_tag = True, # test optional image tagging
image_registry = REGISTRY, # override the default registry host for production
image_repository_prefix = "k8s",
images = {
Expand Down
2 changes: 1 addition & 1 deletion skylib/push.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _impl(ctx):
)

if ctx.attr.image_digest_tag:
tag = "$(cat {} | sed 's/sha256://')".format(ctx.outputs.digest.path.replace("_push", ""))
tag = "$(cat {} | cut -d ':' -f 2 | cut -c 1-7)".format(ctx.outputs.digest.path)

pusher_args.append("--format={}".format(ctx.attr.format))
pusher_args.append("--dst={registry}/{repository}:{tag}".format(
Expand Down

0 comments on commit 9e6d1f9

Please sign in to comment.