0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-09-20 01:42:45 +02:00

chore: some improvements to build automation

This commit is contained in:
Jacob McCann 2019-07-12 07:55:47 -05:00
parent d26c2a73ab
commit 7d1e39a8e0
No known key found for this signature in database
GPG Key ID: B5A476DE32B9AE72
2 changed files with 8 additions and 2 deletions

View File

@ -7,9 +7,13 @@ RUN apk add --no-cache git
RUN mkdir -p /tmp/drone-terraform RUN mkdir -p /tmp/drone-terraform
WORKDIR /tmp/drone-terraform WORKDIR /tmp/drone-terraform
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
COPY . . COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
FROM alpine:3.9 FROM alpine:3.9

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
tag=$1 tag=$1
if [ -z $tag ]; then if [ -z $tag ]; then
@ -25,9 +27,9 @@ if [[ "$ans" != "Y" && "$ans" != "y" ]]; then
exit 0 exit 0
fi fi
set -x
docker build -t jmccann/drone-terraform:latest . 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}
docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor} docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor}
docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor}-${tf_ver} docker tag jmccann/drone-terraform:latest jmccann/drone-terraform:${major}.${minor}-${tf_ver}