Browse Source
chore: some improvements to build automation
pull/96/head
Jacob McCann
6 years ago
No known key found for this signature in database
GPG Key ID: B5A476DE32B9AE72
2 changed files with
8 additions and
2 deletions
-
Dockerfile
-
build-docker.sh
|
|
@ -7,9 +7,13 @@ RUN apk add --no-cache git |
|
|
|
|
|
|
|
RUN mkdir -p /tmp/drone-terraform |
|
|
|
WORKDIR /tmp/drone-terraform |
|
|
|
COPY . . |
|
|
|
|
|
|
|
COPY go.mod go.mod |
|
|
|
COPY go.sum go.sum |
|
|
|
RUN go mod download |
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform |
|
|
|
|
|
|
|
FROM alpine:3.9 |
|
|
|
|
|
@ -1,5 +1,7 @@ |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
tag=$1 |
|
|
|
|
|
|
|
if [ -z $tag ]; then |
|
|
@ -25,9 +27,9 @@ if [[ "$ans" != "Y" && "$ans" != "y" ]]; then |
|
|
|
exit 0 |
|
|
|
fi |
|
|
|
|
|
|
|
set -x |
|
|
|
docker build -t jmccann/drone-terraform:latest . |
|
|
|
|
|
|
|
set -x |
|
|
|
docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major} |
|
|
|
docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor} |
|
|
|
docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor}-${tf_ver} |
|
|
|