-
Notifications
You must be signed in to change notification settings - Fork 40
Makefile things #313
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
Merged
Merged
Makefile things #313
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
86e2dba
Bump KCP to v0.28.1
ntnn 2227cad
Start KCP on localhost only
ntnn 01fef7c
Fix dex install in workdirs
ntnn 416d805
Formatting
ntnn 70c8707
Add KCP_CMD
ntnn b500b43
Default E2E_PARALLELISM based on nproc
ntnn 781ebb2
Symlink dex and kcp in hack/tools
ntnn 5a1e6b9
Add run-dex
ntnn 2ced331
Drop cloning dex
ntnn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,9 +77,10 @@ CODE_GENERATOR_BIN := code-generator | |
| CODE_GENERATOR := $(TOOLS_GOBIN_DIR)/$(CODE_GENERATOR_BIN)-$(CODE_GENERATOR_VER) | ||
| export CODE_GENERATOR # so hack scripts can use it | ||
|
|
||
| KCP_VER := v0.28.0 | ||
| KCP_VER := v0.28.1 | ||
| KCP_BIN := kcp | ||
| KCP := $(TOOLS_GOBIN_DIR)/$(KCP_BIN)-$(KCP_VER) | ||
| KCP_CMD ?= $(KCP) | ||
|
|
||
| DEX_VER := v2.43.1 | ||
| DEX_BIN := dex | ||
|
|
@@ -128,9 +129,9 @@ build: require-jq require-go require-git verify-go-versions ## Build the project | |
| mkdir -p $(GOBIN_DIR) | ||
| set -x; for W in $(WHAT); do \ | ||
| pushd . && cd $${W%..}; \ | ||
| GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build $(BUILDFLAGS) -ldflags="$(LDFLAGS)" -o $(GOBIN_DIR) ./...; \ | ||
| GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build $(BUILDFLAGS) -ldflags="$(LDFLAGS)" -o $(GOBIN_DIR) ./...; \ | ||
| popd; \ | ||
| done | ||
| done | ||
| .PHONY: build | ||
|
|
||
| install: WHAT ?= ./cmd/... ./cli/cmd/... | ||
|
|
@@ -241,27 +242,28 @@ GO_TEST = $(GOTESTSUM) $(GOTESTSUM_ARGS) -- | |
| endif | ||
|
|
||
| COUNT ?= 1 | ||
| E2E_PARALLELISM ?= 1 | ||
|
|
||
| dex: | ||
| git clone https://github.com/dexidp/dex.git | ||
| dex/bin/dex: dex | ||
| (cd dex; make) | ||
| NPROC ?= $$(( $(shell nproc) / 2 )) | ||
| E2E_PARALLELISM ?= $$(( $(NPROC) > 1 ? $(NPROC) : 1)) | ||
|
|
||
| $(DEX): | ||
| mkdir -p $(TOOLS_DIR) | ||
| git clone --branch $(DEX_VER) --depth 1 https://github.com/dexidp/dex $(TOOLS_DIR)/dex-clone-$(DEX_VER) | ||
| cd $(TOOLS_DIR)/dex-clone-$(DEX_VER) && make build | ||
| git clone --branch $(DEX_VER) --depth 1 https://github.com/dexidp/dex $(TOOLS_DIR)/dex-clone-$(DEX_VER) || true | ||
| cd $(TOOLS_DIR)/dex-clone-$(DEX_VER) && GOWORK=off make build | ||
| cp -a $(TOOLS_DIR)/dex-clone-$(DEX_VER)/bin/dex $(DEX) | ||
| ln -sf $(DEX) $(TOOLS_GOBIN_DIR)/dex | ||
|
|
||
| run-dex: $(DEX) | ||
| $(DEX) serve hack/dex-config-dev.yaml | ||
|
|
||
| $(KCP): | ||
| mkdir -p $(TOOLS_DIR) | ||
| curl --fail --retry 3 -L "https://github.com/kcp-dev/kcp/releases/download/$(KCP_VER)/kcp_$(KCP_VER:v%=%)_$(OS)_$(ARCH).tar.gz" | \ | ||
| tar xz -C "$(TOOLS_DIR)" --strip-components="1" bin/kcp | ||
| mv $(TOOLS_DIR)/kcp $(KCP) | ||
| ln -sf $(KCP) $(TOOLS_GOBIN_DIR)/kcp | ||
|
|
||
| run-kcp: $(KCP) | ||
| $(KCP) start | ||
| $(KCP_CMD) start --bind-address=127.0.0.1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this works with ever changing IP address on the local interface? O_O |
||
|
|
||
| .PHONY: test-e2e | ||
| ifdef USE_GOTESTSUM | ||
|
|
@@ -272,8 +274,8 @@ test-e2e: WORK_DIR ?= . | |
| test-e2e: WHAT ?= ./test/e2e... | ||
| test-e2e: $(KCP) $(DEX) build ## Run e2e tests | ||
| mkdir .kcp | ||
| $(DEX) serve hack/dex-config-dev.yaml 2>&1 & DEX_PID=$$!; \ | ||
| $(KCP) start &>.kcp/kcp.log & KCP_PID=$$!; \ | ||
| $(MAKE) run-dex 2>&1 & DEX_PID=$$!; \ | ||
| $(MAKE) run-kcp &>.kcp/kcp.log & KCP_PID=$$!; \ | ||
| trap 'kill -TERM $$DEX_PID $$KCP_PID; rm -rf .kcp' TERM INT EXIT && \ | ||
| echo "Waiting for kcp to be ready (check .kcp/kcp.log)." && while ! KUBECONFIG=.kcp/admin.kubeconfig kubectl get --raw /readyz &>/dev/null; do sleep 1; echo -n "."; done && echo && \ | ||
| KUBECONFIG=$$PWD/.kcp/admin.kubeconfig GOOS=$(OS) GOARCH=$(ARCH) $(GO_TEST) -race -count $(COUNT) -p $(E2E_PARALLELISM) -parallel $(E2E_PARALLELISM) $(WHAT) $(TEST_ARGS) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sort-of references in docs/content/setup/quickstart.md, where it says to clone the dex repo, but makes no mention of the makefile.
I don't think we need these recipes.