Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .changelog/27310.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
build: Add dev-static and static-release build targets that disable CGO and offer statically-linked binaries
```
11 changes: 11 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ dev: hclfmt ## Build for the current development platform
@cp $(PROJECT_ROOT)/$(DEV_TARGET) $(PROJECT_ROOT)/bin/
@cp $(PROJECT_ROOT)/$(DEV_TARGET) $(BIN)

.PHONY: dev-static
dev-static:
@$(MAKE) CGO_ENABLED=0 dev ## Build a dev binary with no CGO

.PHONY: prerelease
prerelease: GO_TAGS=ui codegen_generated release
prerelease: generate-all ember-dist static-assets ## Generate all the static assets for a Nomad release
Expand All @@ -297,6 +301,13 @@ release: clean $(foreach t,$(ALL_TARGETS),pkg/$(t).zip) ## Build all release pac
@echo "==> Results:"
@tree --dirsfirst $(PROJECT_ROOT)/pkg

.PHONY: release-static
release-static: GO_TAGS=ui codegen_generated release
release-static: CGO_ENABLED=0
release-static: clean $(foreach t,$(ALL_TARGETS),pkg/$(t).zip) ## Build all release packages which can be built on this platform.
@echo "==> Results:"
@tree --dirsfirst $(PROJECT_ROOT)/pkg

.PHONY: test-nomad
test-nomad: GOTEST_PKGS=$(foreach g,$(GOTEST_GROUP),$(shell go run -modfile=tools/go.mod tools/missing/main.go ci/test-core.json $(g)))
test-nomad: # dev ## Run Nomad unit tests
Expand Down
Loading
Loading