Skip to content

Commit

Permalink
Rename subctl binary to subctl
Browse files Browse the repository at this point in the history
Currently while building a subctl is binary is named as
`subctl-$version-$arch`. This PR does following changes while creating a
tar of the binary:

1. Rename the binary to just `subctl`. This is one of the requirements
   of Krew.
2. Remove the redundant child directory so that on untar'ing the binary
   is at `subctl-$version-$arch/` path instead of
   `subctl-$version-$arch/subctl-$version`

Epic: submariner-io/enhancements#182

Signed-off-by: Janki Chhatbar <[email protected]>
  • Loading branch information
Jaanki committed Jul 5, 2023
1 parent 9371f08 commit ed4a63d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ include $(SHIPYARD_DIR)/Makefile.inc
gotodockerarch = $(patsubst arm,arm/v7,$(1))
dockertogoarch = $(patsubst arm/v7,arm,$(1))

CROSS_TARGETS := linux-amd64 linux-arm64 linux-arm linux-s390x linux-ppc64le windows-amd64.exe darwin-amd64 darwin-arm64
CROSS_TARGETS := linux-amd64 #linux-arm64 linux-arm linux-s390x linux-ppc64le windows-amd64.exe darwin-amd64 darwin-arm64
BINARIES := cmd/bin/subctl
CROSS_BINARIES := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,cmd/bin/subctl-$(VERSION)-%,$(cross)))
CROSS_TARBALLS := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.xz,$(cross))) \
$(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.gz,$(cross)))
CROSS_TARBALLS := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.gz,$(cross))) #\
#$(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.gz,$(cross)))

override E2E_ARGS += cluster1 cluster2
export DEPLOY_ARGS
Expand Down Expand Up @@ -92,11 +92,11 @@ cmd/bin/subctl: cmd/bin/subctl-$(VERSION)-$(GOOS)-$(GOARCH)$(GOEXE)

dist/subctl-%.tar.xz: cmd/bin/subctl-%
mkdir -p dist
tar -cJf $@ --transform "s/^cmd.bin/subctl-$(VERSION)/" $<
tar -cJf $@ --transform "s|^cmd/bin/subctl-[^/]*|subctl|" $<

dist/subctl-%.tar.gz: cmd/bin/subctl-%
mkdir -p dist
tar -czf $@ --transform "s/^cmd.bin/subctl-$(VERSION)/" $<
tar -cf $@ --transform "s|^cmd/bin/subctl-[^/]*|subctl|" $<

dist/subctl-checksums.txt: $(CROSS_TARBALLS)
cd $(@D) && sha256sum $(^F) >> $(@F)
Expand Down

0 comments on commit ed4a63d

Please sign in to comment.