Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit 19764a3

Browse files
committed
build: add make package target
1 parent 8493b9a commit 19764a3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ARCH = $(shell uname -m | sed -e 's/x86_64/amd64/g' -e 's/i686/i386/g')
3333
PLATFORM = $(shell uname | tr '[:upper:]' '[:lower:]')
3434
PLUGINS = $(sort $(dir $(wildcard $(BASE)/plugins/*/)))
3535
DEBUG = 0
36+
DISTPKGDIR = 'target/package'
3637

3738
GO = go
3839
GODOC = godoc
@@ -275,6 +276,17 @@ changelog: ## Outputs the changes since the last version committed
275276
column -s " " -t | \
276277
sed -e 's/^/ * /'
277278

279+
$(DISTPKGDIR)/nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz: app
280+
$(info $(M) building compressed binary of nginx-wrapper app for $(PLATFORM)_$(ARCH))
281+
$Q mkdir -p $(DISTPKGDIR)
282+
$Q gzip --stdout --name --best $(OUTPUT_DIR)/nginx-wrapper > $(DISTPKGDIR)/nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz
283+
284+
$(DISTPKGDIR)/nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz.sha256sum: $(DISTPKGDIR)/nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz
285+
$(info $(M) writing SHA256 checksum of nginx-wrapper app)
286+
$Q cd $(DISTPKGDIR); sha256sum nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz > nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz.sha256sum
287+
288+
package: $(DISTPKGDIR)/nginx-wrapper-$(PLATFORM)_$(ARCH)-$(VERSION).gz.sha256sum ## Builds packaged artifact of app
289+
278290
.PHONY: clean
279291
clean: ; $(info $(M) cleaning...) @ ## Cleanup everything
280292
@chmod -R +w $(GOPATH) || true

0 commit comments

Comments
 (0)