-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from netsampler/feature/arm
feature: add arm builds
- Loading branch information
Showing
5 changed files
with
40 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
EXTENSION ?= | ||
DIST_DIR ?= dist/ | ||
GOOS ?= linux | ||
ARCH ?= $(shell uname -m) | ||
EXTENSION ?= | ||
DIST_DIR ?= dist/ | ||
GOOS ?= linux | ||
ARCH ?= $(shell uname -m) | ||
BUILDINFOSDET ?= | ||
|
||
DOCKER_REPO := netsampler/ | ||
|
@@ -11,14 +11,15 @@ ABBREV ?= $(shell git rev-parse --short HEAD) | |
COMMIT ?= $(shell git rev-parse HEAD) | ||
TAG ?= $(shell git describe --tags --abbrev=0 HEAD) | ||
VERSION_PKG ?= $(shell echo $(VERSION) | sed 's/^v//g') | ||
ARCH := x86_64 | ||
LICENSE := BSD-3-Clause | ||
URL := https://github.com/netsampler/goflow2 | ||
DESCRIPTION := GoFlow2: Open-Source and Scalable Network Sample Collector | ||
DATE := $(shell date +%FT%T%z) | ||
BUILDINFOS ?= ($(DATE)$(BUILDINFOSDET)) | ||
LDFLAGS ?= '-X main.version=$(VERSION) -X main.buildinfos=$(BUILDINFOS)' | ||
MAINTAINER := [email protected] | ||
DOCKER_CMD ?= build | ||
DOCKER_SUFFIX ?= | ||
|
||
OUTPUT := $(DIST_DIR)goflow2-$(VERSION_PKG)-$(GOOS)-$(ARCH)$(EXTENSION) | ||
|
||
|
@@ -50,7 +51,7 @@ build: prepare | |
|
||
.PHONY: docker | ||
docker: | ||
docker build \ | ||
docker $(DOCKER_CMD) \ | ||
--build-arg LDFLAGS=$(LDFLAGS) \ | ||
--build-arg CREATED="$(DATE)" \ | ||
--build-arg MAINTAINER="$(MAINTAINER)" \ | ||
|
@@ -60,18 +61,30 @@ docker: | |
--build-arg LICENSE="$(LICENSE)" \ | ||
--build-arg VERSION="$(VERSION)" \ | ||
--build-arg REV="$(COMMIT)" \ | ||
-t $(DOCKER_REPO)$(NAME):$(ABBREV) . | ||
-t $(DOCKER_REPO)$(NAME):$(ABBREV)$(DOCKER_SUFFIX) . | ||
|
||
.PHONY: push-docker | ||
push-docker: | ||
docker push $(DOCKER_REPO)$(NAME):$(ABBREV) | ||
docker tag $(DOCKER_REPO)$(NAME):$(ABBREV) $(DOCKER_REPO)$(NAME):latest | ||
docker push $(DOCKER_REPO)$(NAME):latest | ||
docker push $(DOCKER_REPO)$(NAME):$(ABBREV)$(DOCKER_SUFFIX) | ||
|
||
.PHONY: push-docker-release | ||
push-docker-release: | ||
docker tag $(DOCKER_REPO)$(NAME):$(ABBREV) $(DOCKER_REPO)$(NAME):$(VERSION) | ||
docker push $(DOCKER_REPO)$(NAME):$(VERSION) | ||
.PHONY: docker-manifest | ||
docker-manifest: | ||
docker manifest create $(DOCKER_REPO)$(NAME):$(ABBREV) \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-amd64 \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-arm64 | ||
docker manifest push $(DOCKER_REPO)$(NAME):$(ABBREV) | ||
|
||
docker manifest create $(DOCKER_REPO)$(NAME):latest \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-amd64 \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-arm64 | ||
docker manifest push $(DOCKER_REPO)$(NAME):latest | ||
|
||
.PHONY: docker-manifest-release | ||
docker-manifest-release: | ||
docker manifest create $(DOCKER_REPO)$(NAME):$(VERSION) \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-amd64 \ | ||
--amend $(DOCKER_REPO)$(NAME):$(ABBREV)-arm64 | ||
docker manifest push $(DOCKER_REPO)$(NAME):$(VERSION) | ||
|
||
.PHONY: package-deb | ||
package-deb: prepare | ||
|