Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the released CLI artifacts #204

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ jobs:
# native image and build multiarch images later
- name: Bake native images for security scanning
run: BAKE_OUTPUT=docker make build-native
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Bake and push multiarch images
if: ${{ github.event_name == 'push' && !env.ACT }}
run: BAKE_OUTPUT=registry make build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# TODO: can we loop this somehow?
- name: Run Trivy vulnerability scanner on Server image
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CGO_ENABLED ?= 0

TEMPORAL_ROOT := temporal
TCTL_ROOT := tctl
CLI_ROOT := cli
DOCKERIZE_ROOT := dockerize
CLI_VER := v0.12.0
tdeebswihart marked this conversation as resolved.
Show resolved Hide resolved
IMAGE_TAG ?= sha-$(shell git rev-parse --short HEAD)
TEMPORAL_SHA := $(shell sh -c 'git submodule status -- temporal | cut -c2-40')
TCTL_SHA := $(shell sh -c "git submodule status -- tctl | cut -c2-40")
Expand Down Expand Up @@ -44,6 +44,8 @@ update-submodules:

# If you're new to Make, this is a pattern rule: https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html#Pattern-Rules
# $* expands to the stem that matches the %, so when the target is amd64-bins $* expands to amd64
#
# NOTE(tdeebswihart): Please forgive me for the `gh` invocation below, but it means there are no temporary files I need to care about
%-bins:
@mkdir -p build/$*
@cd $(DOCKERIZE_ROOT) && CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$* go build -o ../build/$*/dockerize .
Expand All @@ -52,11 +54,11 @@ update-submodules:
@cp $(TEMPORAL_ROOT)/temporal-cassandra-tool build/$*/
@cp $(TEMPORAL_ROOT)/temporal-sql-tool build/$*/
@cp $(TEMPORAL_ROOT)/tdbg build/$*/
@cd $(CLI_ROOT) && GOOS=linux GOARCH=$* CGO_ENABLED=$(CGO_ENABLED) go build ./cmd/temporal
@cp ./$(CLI_ROOT)/temporal build/$*/
@GOOS=linux GOARCH=$* CGO_ENABLED=$(CGO_ENABLED) make -C $(TCTL_ROOT) build
@cp ./$(TCTL_ROOT)/tctl build/$*/
@cp ./$(TCTL_ROOT)/tctl-authorization-plugin build/$*/
@gh release -R temporalio/cli download $(CLI_VER) -p "*linux_$(*).tar.gz" -O - | tar --to-stdout -z -x -v -f - temporal > build/$*/temporal
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@gh release -R temporalio/cli download $(CLI_VER) -p "*linux_$(*).tar.gz" -O - | tar --to-stdout -z -x -v -f - temporal > build/$*/temporal
@curl -L https://github.com/temporalio/cli/releases/download/v$(CLI_VER)/temporal_cli_$(CLI_VER)_linux_$(*).tar.gz | tar --to-stdout -z -x -v -f - temporal > build/$*/temporal

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferable to using gh imho.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why's that?

@chmod +x build/$*/temporal

.PHONY: bins
.NOTPARALLEL: bins
Expand Down
Loading