diff --git a/.drone.yml b/.drone.yml index 5ee127f..4215aeb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ publish: plugin: name: Terraform desc: Execute Terraform commands - type: notify - image: plugins/drone-terraform + type: deploy + image: objectpartners/drone-terraform labels: - terraform diff --git a/DOCS.md b/DOCS.md new file mode 100644 index 0000000..e2b55bd --- /dev/null +++ b/DOCS.md @@ -0,0 +1,25 @@ +Use the Terraform plugin to apply the infrastructure configuration contained within the repository. The following parameters are used to configure this plugin: + +* `dryRun` - if true, calculates a plan but does __NOT__ apply it. +* `remote` - contains the configuration for the Terraform remote state tracking. + * `backend` - the Terrafrom remote state backend to use. + * `config` - a map of configuration parameters for the remote state backend. Each value is passed as a `-backend-config==` option. +* `vars` - a map of variables to pass to the Terraform `plan` and `apply` commands. Each value is passed as a `-var =` option. + +The following is a sample Terraform configuration in your .drone.yml file: + +```yaml +deploy: + terraform: + image: objectpartners/drone-terraform:latest + dryRun: false + remote: + backend: S3 + config: + bucket: my-terraform-config-bucket + key: tf-states/my-project + region: us-east-1 + vars: + app_name: my-project + app_version: 1.0.0 +``` diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13d6975 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +deps: + GO15VENDOREXPERIMENT=1 go get -u ./... + +build: + GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build + +clean: + rm drone-terraform diff --git a/README.md b/README.md index df9a59d..84b4519 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ -# drone-terraform -Drone plugin for triggering Terraform deployments +# Drone Terraform Deploy Plugin + +This project provides a [Drone](drone.io) plugin docker image that contains the [Terraform](terraform.io) binaries and a small Go app that receives the Drone meta-data and executes Terraform commands. + +Documentation for Drone Plugin development can be found here: http://readme.drone.io/plugin/ + +See [DOCS](docs.md) for details on this plugin's configuration and usage.