Skip to content

Commit

Permalink
Install grpcurl in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenh committed Jan 22, 2025
1 parent 745f5fa commit f90211b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
-
name: Install tools
run: |
make install-grpcurl
echo "GRPCURL=$(realpath .ext/bin/grpcurl)" >> "$GITHUB_ENV"
-
name: Install topaz CLI
run: |
Expand Down
8 changes: 4 additions & 4 deletions charts/directory/test/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tests:
run:
# Create a tenant.
- |
grpcurl -plaintext -H "Authorization: basic apikey_writer" \
${GRPCURL:=grpcurl} -plaintext -H "Authorization: basic apikey_writer" \
-d '{"tenant": {"id": "3dbaa470-9c7e-11ef-bf36-00fcb2a75cb1", "name": "test-tenant"}}' \
localhost:8282 aserto.directory.store.v2.Store.CreateTenant
Expand All @@ -49,7 +49,7 @@ tests:
cleanup:
# Delete tenant.
- |
grpcurl -plaintext -H "Authorization: basic apikey_writer" \
${GRPCURL:=grpcurl} -plaintext -H "Authorization: basic apikey_writer" \
-d '{"id": "3dbaa470-9c7e-11ef-bf36-00fcb2a75cb1"}' \
localhost:8282 aserto.directory.store.v2.Store.DeleteTenant
Expand Down Expand Up @@ -95,7 +95,7 @@ tests:
run:
# Create a tenant.
- |
grpcurl -insecure -H "Authorization: basic apikey_writer" \
${GRPCURL:=grpcurl} -insecure -H "Authorization: basic apikey_writer" \
-d '{"tenant": {"id": "3dbaa470-9c7e-11ef-bf36-00fcb2a75cb1", "name": "test-tenant"}}' \
localhost:8282 aserto.directory.store.v2.Store.CreateTenant
Expand All @@ -114,6 +114,6 @@ tests:
- diff charts/directory/test/manifest.yaml $TMPDIR/manifest.yaml
cleanup:
- |
grpcurl -insecure -H "Authorization: basic apikey_writer" \
docker run --network="host" fullstorydev/grpcurl -insecure -H "Authorization: basic apikey_writer" \
-d '{"id": "3dbaa470-9c7e-11ef-bf36-00fcb2a75cb1"}' \
localhost:8282 aserto.directory.store.v2.Store.DeleteTenant
13 changes: 12 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CHARTS := ${shell ls ${CHARTS_DIR}}
BUMP_PART ?= patch

CT_VERSION := 3.11.0
GRPCURL_VERSION := 1.9.2

BIN_DIR := ./bin
EXT_DIR := ./.ext
Expand All @@ -25,7 +26,7 @@ CT_LINT_CMD := ${EXT_BIN_DIR}/ct lint --config ct.yaml \


.PHONY: deps
deps: install-ct install-bumpversion;
deps: install-ct install-bumpversion install-grpcurl;

.PHONY: clean
clean: ${addprefix clean-,${CHARTS}}
Expand Down Expand Up @@ -122,6 +123,16 @@ install-bumpversion: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@pip install bump2version

.PHONY: install-grpcurl
install-grpcurl: ${EXT_TMP_DIR} ${EXT_BIN_DIR}
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@gh release download v${GRPCURL_VERSION} --repo https://github.com/fullstorydev/grpcurl \
--pattern "grpcurl_${GRPCURL_VERSION}_$$(uname -s | tr '[:upper:]' '[:lower:]' | sed s/darwin/osx/)_$$(uname -m).tar.gz" \
--output "${EXT_TMP_DIR}/grpcurl.tar.gz" --clobber
@tar -xvf ${EXT_TMP_DIR}/grpcurl.tar.gz --directory ${EXT_BIN_DIR} grpcurl
@chmod +x ${EXT_BIN_DIR}/grpcurl
@${EXT_BIN_DIR}/grpcurl -version

${BIN_DIR}:
@echo -e "$(ATTN_COLOR)==> $@ $(NO_COLOR)"
@mkdir -p ${BIN_DIR}
Expand Down

0 comments on commit f90211b

Please sign in to comment.