-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9d0e2d9
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.tfvars | ||
*.tfplan | ||
*.tfstate | ||
*.tfstate.backup | ||
crash.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" {} |