Skip to content

Commit

Permalink
parse current docker context from ls output (#994)
Browse files Browse the repository at this point in the history
Signed-off-by: Sunny Yip <sunny@kusari.dev>
  • Loading branch information
sunnyyip committed Jun 29, 2023
1 parent 165ec24 commit fcedbd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -97,17 +97,18 @@ build_bins:
# Build bins and copy to ./bin to align with docs
# Separate build_bins as its own target to ensure (workaround) goreleaser finish writing dist/artifacts.json
.PHONY: build
build: build_bins
build: check-goreleaser-tool-check build_bins
@mkdir -p bin
@echo "$(shell cat dist/artifacts.json | jq '.[]| { path: .path, name: .extra.ID } | join(" ")' -r)" | xargs -n 2 sh -c 'cp $$0 ./bin/$$1'
@echo "\nThe guac bins are available in ./bin"

.PHONY: build_local_container
build_local_container: GORELEASER_CURRENT_TAG ?= v0.0.0-$(LOCAL_IMAGE_NAME)
build_local_container:
# docker CLI options are inconsistent across platforms; had to use the pretty print output here to extract the current context
GITHUB_REPOSITORY=$(GITHUB_REPOSITORY) \
GORELEASER_CURRENT_TAG=$(GORELEASER_CURRENT_TAG) \
DOCKER_CONTEXT=$(shell docker context show) \
DOCKER_CONTEXT=$(shell docker context ls | grep '*' | awk '{print $$1}') \
goreleaser release --clean --snapshot --skip-sign --skip-sbom

# Build and package a guac container for local testing
Expand Down

0 comments on commit fcedbd0

Please sign in to comment.