Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lnguyen committed Oct 16, 2014
0 parents commit 9d0e2d9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.tfvars
*.tfplan
*.tfstate
*.tfstate.backup
crash.log
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
all: plan apply destroy

plan:
terraform plan -var-file terraform.tfvars -out terraform.tfplan

apply:
terraform apply -var-file terraform.tfvars

destroy:
terraform plan -destroy -var-file terraform.tfvars -out terraform.tfplan
terraform apply terraform.tfplan

clean:
rm terraform.tfplan
rm terraform.tfstate

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# terraform-cf-upload

The goal of this repo is to automate cloud foundry community build to s3 using docker and digital ocean.

## Usage

```
mkdir terraform-cf-upload
cd terraform-cf-upload
terraform apply github.com/longnguyen11288/terraform-cf-upload
```

If repo is cloned. Just `mv terraform.tfvars.example terraform.tfvars` and edit variables and run `make`. This shall create and run workload and destroy image
20 changes: 20 additions & 0 deletions cf-upload.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
provider "digitalocean" {
token = "${var.do_token}"
}

resource "digitalocean_droplet" "docker" {
image = "6734560"
name = "docker"
region = "nyc2"
size = "2gb"
ssh_keys = ["${var.ssh_key_id}"]
connection {
user = "root"
key_file = "${var.key_path}"
}
provisioner "remote-exec" {
inline = [
"docker run lnguyen/cf-share-release /workspace/create_release.sh ${var.cf_version} ${var.aws_access_key} ${var.aws_secret_key}",
]
}
}
6 changes: 6 additions & 0 deletions terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
aws_access_key = ""
aws_secret_key = ""
do_token = ""
key_path = ""
ssh_key_id = ""
cf_version = ""
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "do_token" {}
variable "key_path" {}
variable "cf_version" {}
variable "ssh_key_id" {}

0 comments on commit 9d0e2d9

Please sign in to comment.