2016-02-21 11:38:13 +00:00
|
|
|
# drone-terraform
|
2015-11-10 14:52:53 +00:00
|
|
|
|
2016-10-20 14:34:28 +00:00
|
|
|
[![Build Status](http://beta.drone.io/api/badges/jmccann/drone-terraform/status.svg)](http://beta.drone.io/jmccann/drone-terraform)
|
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
Drone plugin to execute Terraform plan and apply. For the usage information and
|
|
|
|
a listing of the available options please take a look at [the docs](DOCS.md).
|
2015-11-10 14:52:53 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
## Build
|
2015-11-10 14:52:53 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
Build the binary with the following commands:
|
2016-02-21 11:38:13 +00:00
|
|
|
|
|
|
|
```
|
2016-10-20 14:21:42 +00:00
|
|
|
go build
|
|
|
|
go test
|
2016-02-21 11:38:13 +00:00
|
|
|
```
|
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
## Docker
|
2016-02-21 11:38:13 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
Build the docker image with the following commands:
|
2016-02-21 11:38:13 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
```
|
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
|
|
|
|
docker build --rm=true -t jmccann/drone-terraform .
|
|
|
|
```
|
2016-02-21 11:38:13 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
Please note incorrectly building the image for the correct x64 linux and with
|
|
|
|
GCO disabled will result in an error when running the Docker image:
|
2016-02-21 11:38:13 +00:00
|
|
|
|
|
|
|
```
|
2016-10-20 14:21:42 +00:00
|
|
|
docker: Error response from daemon: Container command
|
|
|
|
'/bin/drone-terraform' not found or does not exist.
|
2016-02-21 11:38:13 +00:00
|
|
|
```
|
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
## Usage
|
2016-02-21 11:38:13 +00:00
|
|
|
|
2016-10-20 14:21:42 +00:00
|
|
|
Execute from the working directory:
|
|
|
|
|
|
|
|
```
|
|
|
|
docker run --rm \
|
|
|
|
-v $(pwd):$(pwd) \
|
|
|
|
-w $(pwd) \
|
2017-09-06 18:52:01 +00:00
|
|
|
jmccann/drone-terraform:latest --plan
|
2016-02-21 11:38:13 +00:00
|
|
|
```
|
2016-12-22 14:20:05 +00:00
|
|
|
|
|
|
|
## Drone 0.4
|
|
|
|
|
|
|
|
Legacy `drone-terraform` plugin exists @ `jmccann/drone-terraform:0.4`
|