Skip to content

Commit

Permalink
Improve the examples for cf app
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishth09 committed Jun 2, 2017
1 parent e20fcf3 commit 5855f4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions examples/ibmcloud-cf-app/main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
resource "null_resource" "prepare_app_zip" {
triggers = {
app_version = "${var.app_version}"
git_repo = "${var.git_repo}"
}

provisioner "local-exec" {
command = "mkdir -p ${var.dir_to_clone}; cd ${var.dir_to_clone}; git init; git remote add origin ${var.git_repo}; git fetch; git checkout -t origin/master; zip -r ${var.app_zip} *"
command = <<EOF
mkdir -p ${var.dir_to_clone}
cd ${var.dir_to_clone}
git init
git remote add origin ${var.git_repo}
git fetch
git checkout -t origin/master
zip -r ${var.app_zip} *
EOF
}
}

Expand Down Expand Up @@ -41,14 +49,14 @@ resource "ibmcloud_cf_app" "app" {
name = "${var.app_name}"
space_guid = "${data.ibmcloud_cf_space.space.id}"
app_path = "${var.app_zip}"
wait_time_minutes = 2
wait_time_minutes = 10

buildpack = "${var.buildpack}"
disk_quota = 512

command = "${var.command}"
memory = 128
instances = 1
instances = 3
disk_quota = 512
route_guid = ["${ibmcloud_cf_route.route.id}"]
service_instance_guid = ["${ibmcloud_cf_service_instance.service.id}"]
Expand Down
8 changes: 4 additions & 4 deletions examples/ibmcloud-cf-app/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
variable "app_version" {
default = "4"
default = "1"
}

variable "git_repo" {
default = "https://github.com/ashishth09/nodejs-cloudantdb-crud-example"
default = "https://github.com/IBM-Bluemix/nodejs-cloudantdb-crud-example"
}

variable "dir_to_clone" {
Expand All @@ -15,11 +15,11 @@ variable "app_zip" {
}

variable "org" {
default = "ashishth@in.ibm.com"
default = ""
}

variable "space" {
default = "dev"
default = ""
}

variable "route" {
Expand Down

0 comments on commit 5855f4c

Please sign in to comment.