committed by
GitHub
8 changed files with 183 additions and 95 deletions
@ -1,12 +1,109 @@ |
|||
workspace: |
|||
base: /go |
|||
path: src/github.com/drone-plugins/drone-terraform |
|||
path: src/github.com/${DRONE_REPO} |
|||
|
|||
pipeline: |
|||
test: |
|||
image: golang:1.8 |
|||
image: golang:1.9 |
|||
pull: true |
|||
commands: |
|||
- go vet |
|||
- go test -cover -coverprofile=coverage.out |
|||
|
|||
build_linux_amd64: |
|||
image: golang:1.9 |
|||
pull: true |
|||
group: build |
|||
environment: |
|||
- GOOS=linux |
|||
- GOARCH=amd64 |
|||
- CGO_ENABLED=0 |
|||
commands: |
|||
- go test -cover -coverprofile=coverage.out |
|||
- go build -ldflags "-s -w -X main.revision=$(git rev-parse HEAD)" -a |
|||
- go build -v -ldflags "-X main.revision=$(git rev-parse HEAD)" -a -o release/linux/amd64/${DRONE_REPO_NAME} |
|||
|
|||
# build_linux_arm64: |
|||
# image: golang:1.9 |
|||
# pull: true |
|||
# group: build |
|||
# environment: |
|||
# - GOOS=linux |
|||
# - GOARCH=arm64 |
|||
# - CGO_ENABLED=0 |
|||
# commands: |
|||
# - go build -v -ldflags "-X main.revision=$(git rev-parse HEAD)" -a -o release/linux/arm64/${DRONE_REPO_NAME} |
|||
|
|||
build_linux_arm: |
|||
image: golang:1.9 |
|||
pull: true |
|||
group: build |
|||
environment: |
|||
- GOOS=linux |
|||
- GOARCH=arm |
|||
- CGO_ENABLED=0 |
|||
- GOARM=7 |
|||
commands: |
|||
- go build -v -ldflags "-X main.revision=$(git rev-parse HEAD)" -a -o release/linux/arm/${DRONE_REPO_NAME} |
|||
|
|||
# build_windows_amd64: |
|||
# image: golang:1.9-nanoserver |
|||
# pull: true |
|||
# group: build |
|||
# environment: |
|||
# - GOOS=windows |
|||
# - GOARCH=amd64 |
|||
# - CGO_ENABLED=0 |
|||
# commands: |
|||
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/${DRONE_REPO_NAME} |
|||
|
|||
# publish_linux_amd64: |
|||
# image: plugins/docker:17.05 |
|||
# pull: true |
|||
# repo: ${DRONE_REPO} |
|||
# tags: [ latest, 1.0.0, 1.0, 1 ] |
|||
# secrets: [ docker_username, docker_password ] |
|||
# dockerfile: Dockerfile |
|||
# when: |
|||
# branch: master |
|||
# event: push |
|||
|
|||
# publish_linux_arm64: |
|||
# image: plugins/docker:17.05 |
|||
# pull: true |
|||
# repo: ${DRONE_REPO} |
|||
# tags: [ linux-arm64 ] |
|||
# secrets: [ docker_username, docker_password ] |
|||
# dockerfile: Dockerfile.arm64 |
|||
# when: |
|||
# branch: master |
|||
# event: push |
|||
# |
|||
# publish_linux_arm: |
|||
# image: plugins/docker:17.05 |
|||
# pull: true |
|||
# repo: ${DRONE_REPO} |
|||
# tags: [ linux-arm ] |
|||
# secrets: [ docker_username, docker_password ] |
|||
# dockerfile: Dockerfile.arm |
|||
# when: |
|||
# branch: master |
|||
# event: push |
|||
|
|||
# publish_windows_amd64: |
|||
# image: plugins/docker:17.05 |
|||
# pull: true |
|||
# repo: ${DRONE_REPO} |
|||
# tags: [ windows-amd64 ] |
|||
# secrets: [ docker_username, docker_password ] |
|||
# dockerfile: Dockerfile.windows |
|||
# when: |
|||
# branch: master |
|||
# event: push |
|||
|
|||
# microbadger: |
|||
# image: plugins/webhook:1 |
|||
# pull: true |
|||
# secrets: [ webhook_url ] |
|||
# when: |
|||
# branch: master |
|||
# event: push |
|||
# status: [ success ] |
|||
|
@ -1,19 +1,27 @@ |
|||
# Docker image for the Drone Terraform plugin |
|||
# |
|||
# docker build --rm=true -t jmccann/drone-terraform:latest . |
|||
FROM alpine:3.6 as alpine |
|||
RUN apk add -U --no-cache ca-certificates git wget |
|||
|
|||
FROM alpine:3.4 |
|||
|
|||
RUN apk -U add \ |
|||
ca-certificates \ |
|||
git \ |
|||
wget && \ |
|||
rm -rf /var/cache/apk/* |
|||
|
|||
ENV TERRAFORM_VERSION 0.9.11 |
|||
ENV TERRAFORM_VERSION 0.10.3 |
|||
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -O terraform.zip && \ |
|||
unzip terraform.zip -d /bin && \ |
|||
rm -f terraform.zip |
|||
|
|||
ADD drone-terraform /bin/ |
|||
#TODO: need to add rm to scratch |
|||
#FROM scratch |
|||
|
|||
ENV GODEBUG=netdns=go |
|||
#COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ |
|||
#COPY --from=alpine /bin/terraform /bin/terraform |
|||
|
|||
|
|||
|
|||
LABEL org.label-schema.version=latest |
|||
LABEL org.label-schema.vcs-url="https://github.com/jmccann/drone-terraform.git" |
|||
LABEL org.label-schema.name="Drone Terraform" |
|||
LABEL org.label-schema.vendor="jmccann" |
|||
|
|||
ADD release/linux/amd64/drone-terraform /bin/ |
|||
ENTRYPOINT ["/bin/drone-terraform"] |
|||
|
@ -0,0 +1,23 @@ |
|||
FROM alpine:3.6 as alpine |
|||
RUN apk add -U --no-cache ca-certificates git wget |
|||
|
|||
ENV TERRAFORM_VERSION 0.10.3 |
|||
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm.zip -O terraform.zip && \ |
|||
unzip terraform.zip -d /bin && \ |
|||
rm -f terraform.zip |
|||
|
|||
#TODO: need to add rm to scratch |
|||
#FROM scratch |
|||
|
|||
ENV GODEBUG=netdns=go |
|||
|
|||
#COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ |
|||
#COPY --from=alpine /bin/terraform /bin/terraform |
|||
|
|||
LABEL org.label-schema.version=latest |
|||
LABEL org.label-schema.vcs-url="https://github.com/jmccann/drone-terraform.git" |
|||
LABEL org.label-schema.name="Drone Terraform" |
|||
LABEL org.label-schema.vendor="jmccann" |
|||
|
|||
ADD release/linux/arm/drone-terraform /bin/ |
|||
ENTRYPOINT ["/bin/drone-terraform"] |
@ -0,0 +1,23 @@ |
|||
FROM alpine:3.6 as alpine |
|||
RUN apk add -U --no-cache ca-certificates git wget |
|||
|
|||
ENV TERRAFORM_VERSION 0.10.3 |
|||
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm.zip -O terraform.zip && \ |
|||
unzip terraform.zip -d /bin && \ |
|||
rm -f terraform.zip |
|||
|
|||
#TODO: need to add rm to scratch |
|||
#FROM scratch |
|||
|
|||
ENV GODEBUG=netdns=go |
|||
|
|||
#COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ |
|||
#COPY --from=alpine /bin/terraform /bin/terraform |
|||
|
|||
LABEL org.label-schema.version=latest |
|||
LABEL org.label-schema.vcs-url="https://github.com/jmccann/drone-terraform.git" |
|||
LABEL org.label-schema.name="Drone Terraform" |
|||
LABEL org.label-schema.vendor="jmccann" |
|||
|
|||
ADD release/linux/arm64/drone-terraform /bin/ |
|||
ENTRYPOINT ["/bin/drone-terraform"] |
@ -0,0 +1,13 @@ |
|||
FROM microsoft/nanoserver:latest |
|||
|
|||
ENV GODEBUG=netdns=go |
|||
|
|||
ENV TERRAFORM_VERSION 0.10.3 |
|||
|
|||
LABEL org.label-schema.version=latest |
|||
LABEL org.label-schema.vcs-url="https://github.com/jmccann/drone-terraform.git" |
|||
LABEL org.label-schema.name="Drone Terraform" |
|||
LABEL org.label-schema.vendor="jmccann" |
|||
|
|||
ADD release/windows/amd64/drone-terraform /bin/ |
|||
ENTRYPOINT [ "/bin/drone-terraform" ] |
@ -1,46 +0,0 @@ |
|||
[people] |
|||
[people.bradrydzewski] |
|||
name = "Brad Rydzewski" |
|||
email = "brad@drone.io" |
|||
login = "bradrydzewski" |
|||
[people.Bugagazavr] |
|||
name = "Kirill" |
|||
email = "" |
|||
login = "Bugagazavr" |
|||
[people.donny-dont] |
|||
name = "Don Olmstead" |
|||
email = "donny-dont@gmail.com" |
|||
login = "donny-dont" |
|||
[people.jackspirou] |
|||
name = "Jack Spirou" |
|||
email = "" |
|||
login = "jackspirou" |
|||
[people.msteinert] |
|||
name = "Mike Steinert" |
|||
email = "" |
|||
login = "msteinert" |
|||
[people.nlf] |
|||
name = "Nathan LaFreniere" |
|||
email = "" |
|||
login = "nlf" |
|||
[people.tboerger] |
|||
name = "Thomas Boerger" |
|||
email = "thomas@webhippie.de" |
|||
login = "tboerger" |
|||
[people.athieriot] |
|||
name = "Aurélien Thieriot" |
|||
email = "a.thieriot@gmail.com" |
|||
login = "athieriot" |
|||
|
|||
[org] |
|||
[org.core] |
|||
people = [ |
|||
"bradrydzewski", |
|||
"Bugagazavr", |
|||
"donny-dont", |
|||
"jackspirou", |
|||
"msteinert", |
|||
"nlf", |
|||
"tboerger", |
|||
"athieriot" |
|||
] |
@ -1,34 +0,0 @@ |
|||
.PHONY: all clean deps fmt vet test docker |
|||
|
|||
EXECUTABLE ?= drone-terraform |
|||
IMAGE ?= plugins/$(EXECUTABLE) |
|||
COMMIT ?= $(shell git rev-parse --short HEAD) |
|||
|
|||
LDFLAGS = -X "main.buildCommit=$(COMMIT)" |
|||
PACKAGES = $(shell go list ./... | grep -v /vendor/) |
|||
|
|||
all: deps build test |
|||
|
|||
clean: |
|||
go clean -i ./... |
|||
|
|||
deps: |
|||
go get -t ./... |
|||
|
|||
fmt: |
|||
go fmt $(PACKAGES) |
|||
|
|||
vet: |
|||
go vet $(PACKAGES) |
|||
|
|||
test: |
|||
@for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; |
|||
|
|||
docker: |
|||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-s -w $(LDFLAGS)' |
|||
docker build --rm -t $(IMAGE) . |
|||
|
|||
$(EXECUTABLE): $(wildcard *.go) |
|||
go build -ldflags '-s -w $(LDFLAGS)' |
|||
|
|||
build: $(EXECUTABLE) |
Loading…
Reference in new issue