Skip to content
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

feat: add support for reproducible builds #237

Merged
merged 3 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion apm-lambda-extension/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ DOCKER_IMAGE_NAME = observability/apm-lambda-extension
DOCKER_REGISTRY = docker.elastic.co
AGENT_VERSION = $(shell echo $${BRANCH_NAME} | cut -f 2 -d 'v')

# Add support for SOURCE_DATE_EPOCH and reproducble buils
# See https://reproducible-builds.org/specs/source-date-epoch/
SOURCE_DATE_EPOCH ?= 0
kruskall marked this conversation as resolved.
Show resolved Hide resolved

ifndef GOARCH
GOARCH=amd64
endif
Expand Down Expand Up @@ -57,7 +61,11 @@ endif
GOARCH=${GOARCH} make zip
$(MAKE) publish
zip:
cd bin && rm -f extension.zip || true && zip -r extension.zip extensions NOTICE.txt dependencies.asciidoc && cp extension.zip ${GOARCH}.zip
cd bin \
&& rm -f extension.zip || true \
kruskall marked this conversation as resolved.
Show resolved Hide resolved
&& find extensions NOTICE.txt dependencies.asciidoc | xargs touch -d @$(SOURCE_DATE_EPOCH) \
&& zip -X -r extension.zip extensions NOTICE.txt dependencies.asciidoc \
&& cp extension.zip ${GOARCH}.zip
test:
go test extension/*.go -v
env:
Expand Down
2 changes: 1 addition & 1 deletion apm-lambda-extension/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# build the go extension, and then zip up
make all && cd bin && zip -r extension.zip extensions
make all && make zip

# then run this command with amazon stuff exported

Expand Down