Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

Commit

Permalink
Produce reproducible Go builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed Nov 7, 2019
1 parent a5e6180 commit 93a787a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ build: $(build_funcs)

$(build_funcs):
mkdir -p bin/$(@:build-%=%)
GOOS=linux GOARCH=amd64 go build -o bin/$(@:build-%=%)/handler ./$(@:build-%=%)
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags=-buildid= -o bin/$(@:build-%=%)/handler ./$(@:build-%=%)

#
# lint
Expand Down
7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ def __init__(self, app: core.App, name: str, **kwargs,) -> None:
self,
"Build",
project_name=f"{name}-build",
environment=codebuild.BuildEnvironment(
build_image=codebuild.LinuxBuildImage.STANDARD_2_0
),
build_spec=codebuild.BuildSpec.from_object(
{
"version": "0.2",
"env": {"variables": {"GO111MODULE": "on"}},
"phases": {
"install": {"runtime-versions": {"golang": "1.13"}},
"build": {"commands": ["make test", "make build"]},
Expand Down Expand Up @@ -189,6 +191,9 @@ def __init__(self, app: core.App, name: str, **kwargs,) -> None:
self,
"Deploy",
project_name=f"{name}-deploy",
environment=codebuild.BuildEnvironment(
build_image=codebuild.LinuxBuildImage.STANDARD_2_0
),
build_spec=codebuild.BuildSpec.from_object(
{
"version": "0.2",
Expand Down

0 comments on commit 93a787a

Please sign in to comment.