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
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 ?= $(shell git log -1 --pretty=%ct)

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 \
&& 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