-
Notifications
You must be signed in to change notification settings - Fork 243
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 #34 from cloudflare/release-binary
Add release infrastructure for pre-built binaries
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.10.3-stretch | ||
|
||
# Doing mostly what CI is doing here | ||
RUN apt-get update && \ | ||
apt-get install -y apt-transport-https && \ | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648A4A16A23015EEF4A66B8E4052245BD4284CDD && \ | ||
echo "deb https://repo.iovisor.org/apt/xenial xenial main" > /etc/apt/sources.list.d/iovisor.list && \ | ||
apt-get update && \ | ||
apt-get install -y libbcc=0.6.1-1 linux-headers-amd64 | ||
|
||
ENV GO_PACKAGE=github.com/cloudflare/ebpf_exporter | ||
|
||
COPY ./ /go/src/$GO_PACKAGE | ||
|
||
RUN go install -v $GO_PACKAGE/cmd/... |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
RELEASE := $(shell git describe --tags --always --dirty=-dev | sed s'/^v//g') | ||
|
||
RELEASES_DIR := release | ||
|
||
RELEASE_AMD64_DIR := ebpf_exporter-$(RELEASE) | ||
RELEASE_AMD64_BINARY := $(RELEASES_DIR)/$(RELEASE_AMD64_DIR)/ebpf_exporter | ||
|
||
.PHONY: release-binaries | ||
release-binaries: | ||
rm -rf $(RELEASES_DIR)/* | ||
mkdir -p $(RELEASES_DIR)/$(RELEASE_AMD64_DIR) | ||
docker build -t ebpf-exporter-build . | ||
docker run --rm --entrypoint cat ebpf-exporter-build /go/bin/ebpf_exporter > $(RELEASE_AMD64_BINARY) | ||
chmod +x $(RELEASE_AMD64_BINARY) | ||
cd $(RELEASES_DIR) && tar -czf $(RELEASE_AMD64_DIR).tar.gz $(RELEASE_AMD64_DIR) | ||
cd $(RELEASES_DIR) && shasum -a 256 *.tar.gz > sha256sums.txt |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* | ||
!/.gitignore |