This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
forked from mdlavin/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share scripts to build Linux binaries
- Loading branch information
Showing
3 changed files
with
44 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,24 @@ | ||
# This Dockerfile builds on golang:alpine by building Terraform from source | ||
# using the current working directory. | ||
# | ||
# This produces a docker image that contains a working Terraform binary along | ||
# with all of its source code, which is what gets released on hub.docker.com | ||
# as terraform:full. The main releases (terraform:latest, terraform:light and | ||
# the release tags) are lighter images including only the officially-released | ||
# binary from releases.hashicorp.com; these are built instead from | ||
# scripts/docker-release/Dockerfile-release. | ||
|
||
FROM golang:1.11-alpine | ||
LABEL maintainer="HashiCorp Terraform Team <[email protected]>" | ||
|
||
RUN apk add --update git bash openssh make gcc musl-dev | ||
|
||
ENV TF_DEV=true | ||
ENV TF_RELEASE=1 | ||
|
||
WORKDIR $GOPATH/src/github.com/terraform-providers/terraform-provider-aws | ||
COPY . . | ||
RUN make fmt && make build && make test | ||
|
||
WORKDIR $GOPATH | ||
ENTRYPOINT ["terraform"] |
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,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
VERSION=$1 | ||
if [ -z "$VERSION" ]; then | ||
echo "Provide the Terraform provider version number as an argument" | ||
exit -1 | ||
fi | ||
|
||
IMAGE_NAME=terraform-provider-aws-build | ||
docker -D build -t $IMAGE_NAME . | ||
docker run -v $(pwd):/opt/project -e VERSION=${VERSION} -e GIT_SHORT_HASH=$(git rev-parse --short HEAD) --entrypoint /bin/ash $IMAGE_NAME /opt/project/copy-build-output.sh |
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,7 @@ | ||
#!/bin/sh | ||
|
||
OUTPUT_DIR=${VERSION}_patched_${GIT_SHORT_HASH}/linux_amd64 | ||
mkdir -p /opt/project/${OUTPUT_DIR} | ||
cp /go/bin/terraform-provider-aws /opt/project/${OUTPUT_DIR}/terraform-provider-aws_$VERSION | ||
cd /opt/project/${OUTPUT_DIR} | ||
sha256sum terraform-provider-aws_$VERSION > SHA256SUMS |