Use Terraform to automate Drone.io deployment on Digital Ocean
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
.gitignore
LICENSE
README.md
dns.tf
keys.tf
outputs.tf
providers.tf
servers.tf
templates.tf
variables.tf

README.md

Drone.io Deployer

Deploy Drone.io CI on Digital Ocean with Terraform

First you need to:

Then in order to run:

  • Clone the repository and run with in docker with:

With Docker:

docker run -i -t hashicorp/terraform:light terraform apply \
    -var "DO_TOKEN=<YOUR-DIGITAL-OCEAN-TOKEN>" \
    -var "DRONE_GITHUB_CLIENT=<VCS-CLIENT-ID>" \
    -var "DRONE_GITHUB_SECRET=<VCS-CLIENT-SECRET>"

OR like it's still 2013:

Ensure you have terraform installed and then:

terraform apply \
    -var "DO_TOKEN=<YOUR-DIGITAL-OCEAN-TOKEN>" \
    -var "DRONE_GITHUB_CLIENT=<VCS-CLIENT-ID>" \
    -var "DRONE_GITHUB_SECRET=<VCS-CLIENT-SECRET>"

Alternatively, you can set the following environment variables to not have to declare vars:

  • TF_VAR_DO_TOKEN
  • TF_VAR_DRONE_GITHUB_CLIENT
  • TF_VAR_DRONE_GITHUB_SECRET

OR create a terraform.tfvars file in root with the content below.

# Digital Ocean
droplet_name            = "drone-ci"
droplet_region          = "LON1"
droplet_size            = "512"
DO_TOKEN                = ""

# GitHub API token
DRONE_GITHUB_CLIENT     = ""
DRONE_GITHUB_SECRET     = ""

# Drone related
DRONE_SECRET            = ""

..and run with terraform apply in the directory