mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-10 04:10:41 +00:00
Update the README.md to support new plugin structure for Drone 0.5
This commit is contained in:
parent
b89636d36e
commit
b77fa7f0b3
132
README.md
132
README.md
@ -1,123 +1,41 @@
|
|||||||
# drone-terraform
|
# drone-terraform
|
||||||
|
|
||||||
[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-terraform/status.svg)](http://beta.drone.io/drone-plugins/drone-terraform)
|
Drone plugin to execute Terraform plan and apply. For the usage information and
|
||||||
[![Coverage Status](https://aircover.co/badges/drone-plugins/drone-terraform/coverage.svg)](https://aircover.co/drone-plugins/drone-terraform)
|
a listing of the available options please take a look at [the docs](DOCS.md).
|
||||||
[![](https://badge.imagelayers.io/plugins/drone-terraform:latest.svg)](https://imagelayers.io/?images=plugins/drone-terraform:latest 'Get your own badge on imagelayers.io')
|
|
||||||
|
|
||||||
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).
|
## Build
|
||||||
|
|
||||||
## Binary
|
Build the binary with the following commands:
|
||||||
|
|
||||||
Build the binary using `make`:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
make deps build
|
go build
|
||||||
```
|
go test
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./drone-terraform <<EOF
|
|
||||||
{
|
|
||||||
"repo": {
|
|
||||||
"clone_url": "git://github.com/drone/drone",
|
|
||||||
"owner": "drone",
|
|
||||||
"name": "drone",
|
|
||||||
"full_name": "drone/drone"
|
|
||||||
},
|
|
||||||
"system": {
|
|
||||||
"link_url": "https://beta.drone.io"
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"number": 22,
|
|
||||||
"status": "success",
|
|
||||||
"started_at": 1421029603,
|
|
||||||
"finished_at": 1421029813,
|
|
||||||
"message": "Update the Readme",
|
|
||||||
"author": "johnsmith",
|
|
||||||
"author_email": "john.smith@gmail.com",
|
|
||||||
"event": "push",
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
|
|
||||||
"ref": "refs/heads/master"
|
|
||||||
},
|
|
||||||
"workspace": {
|
|
||||||
"root": "/drone/src",
|
|
||||||
"path": "/drone/src/github.com/drone/drone"
|
|
||||||
},
|
|
||||||
"vargs": {
|
|
||||||
"plan": 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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
Build the container using `make`:
|
Build the docker image with the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
make deps docker
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo
|
||||||
|
docker build --rm=true -t jmccann/drone-terraform .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example
|
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:
|
||||||
|
|
||||||
```sh
|
```
|
||||||
docker run -i plugins/drone-terraform <<EOF
|
docker: Error response from daemon: Container command
|
||||||
{
|
'/bin/drone-terraform' not found or does not exist.
|
||||||
"repo": {
|
```
|
||||||
"clone_url": "git://github.com/drone/drone",
|
|
||||||
"owner": "drone",
|
## Usage
|
||||||
"name": "drone",
|
|
||||||
"full_name": "drone/drone"
|
Execute from the working directory:
|
||||||
},
|
|
||||||
"system": {
|
```
|
||||||
"link_url": "https://beta.drone.io"
|
docker run --rm \
|
||||||
},
|
-v $(pwd):$(pwd) \
|
||||||
"build": {
|
-w $(pwd) \
|
||||||
"number": 22,
|
jmccann/drone-terraform --plan
|
||||||
"status": "success",
|
|
||||||
"started_at": 1421029603,
|
|
||||||
"finished_at": 1421029813,
|
|
||||||
"message": "Update the Readme",
|
|
||||||
"author": "johnsmith",
|
|
||||||
"author_email": "john.smith@gmail.com",
|
|
||||||
"event": "push",
|
|
||||||
"branch": "master",
|
|
||||||
"commit": "436b7a6e2abaddfd35740527353e78a227ddcb2c",
|
|
||||||
"ref": "refs/heads/master"
|
|
||||||
},
|
|
||||||
"workspace": {
|
|
||||||
"root": "/drone/src",
|
|
||||||
"path": "/drone/src/github.com/drone/drone"
|
|
||||||
},
|
|
||||||
"vargs": {
|
|
||||||
"plan": 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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user