Skip to content

Commit

Permalink
Merge pull request #1041 from simonbaird/support-testing-with-specifi…
Browse files Browse the repository at this point in the history
…c-ec-ref

Support using arbitrary & specific ec version
  • Loading branch information
simonbaird authored Jun 14, 2024
2 parents f000552 + cc4e540 commit 290417c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ POLICY_DIR=./policy
# Use go run so we use the exact pinned versions from the mod file.
# Use ec for the opa and conftest commands so that our custom rego
# functions are available.
EC=go run github.com/enterprise-contract/ec-cli
ifndef EC_REF
EC_MOD=github.com/enterprise-contract/ec-cli
else
# EC_REF can be set to use ec built from a particular ref, e.g.:
# EC_REF=release-v0.2 make ec-version quiet-test
EC_MOD=github.com/enterprise-contract/ec-cli@$(EC_REF)
endif

EC=go run $(EC_MOD)

OPA=$(EC) opa
CONFTEST=EC_EXPERIMENTAL=1 $(EC)
TKN=go run github.com/tektoncd/cli/cmd/tkn
Expand Down Expand Up @@ -66,6 +75,14 @@ help: ## Display this help.

##@ Development

ec-version:
@echo $(EC_MOD)
@# To confirm that EC_REF is doing what you think it's doing
@go list -m -json $(EC_MOD) | jq -r .Version
@# Actually we get "development" as the version and "0001-01-01"
@# as the change date but let's show it anyhow
@$(EC) version

# Todo maybe: Run tests with conftest verify instead
.PHONY: test
test: ## Run all tests in verbose mode and check coverage
Expand Down

0 comments on commit 290417c

Please sign in to comment.