From fcbd0d1cc8d07707308748b1bca915da82ef316d Mon Sep 17 00:00:00 2001 From: Jordan Caussat Date: Mon, 23 Apr 2018 12:19:27 +0200 Subject: [PATCH 1/3] TER-272: Add description parameter --- ghost/resource_ghost_app.go | 6 ++++++ ghost/resource_ghost_app_test.go | 2 ++ vendor/cloud-deploy.io/go-st/spec.go | 7 ++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ghost/resource_ghost_app.go b/ghost/resource_ghost_app.go index d50c8f2..733f121 100644 --- a/ghost/resource_ghost_app.go +++ b/ghost/resource_ghost_app.go @@ -49,6 +49,10 @@ func resourceGhostApp() *schema.Resource { ForceNew: true, ValidateFunc: MatchesRegexp(`^[a-z0-9\-\_]*$`), }, + "description": { + Type: schema.TypeString, + Optional: true, + }, "region": { Type: schema.TypeString, Optional: true, @@ -547,6 +551,7 @@ func expandGhostApp(d *schema.ResourceData) ghost.App { Name: d.Get("name").(string), Env: d.Get("env").(string), Role: d.Get("role").(string), + Description: d.Get("description").(string), Region: d.Get("region").(string), InstanceType: d.Get("instance_type").(string), VpcID: d.Get("vpc_id").(string), @@ -570,6 +575,7 @@ func flattenGhostApp(d *schema.ResourceData, app ghost.App) error { d.Set("name", app.Name) d.Set("env", app.Env) d.Set("role", app.Role) + d.Set("description", app.Description) d.Set("region", app.Region) d.Set("instance_type", app.InstanceType) d.Set("vpc_id", app.VpcID) diff --git a/ghost/resource_ghost_app_test.go b/ghost/resource_ghost_app_test.go index b37f806..a72d6aa 100644 --- a/ghost/resource_ghost_app_test.go +++ b/ghost/resource_ghost_app_test.go @@ -115,6 +115,7 @@ func testAccGhostAppConfig(name string) string { name = "%s" env = "dev" role = "webfront" + description = "This is a test" region = "eu-west-1" instance_type = "t2.micro" @@ -366,6 +367,7 @@ var ( Name: "app_name", Env: "test", Role: "web", + Description: "My app", Region: "us-west-1", InstanceType: "t2.micro", VpcID: "vpc-123456", diff --git a/vendor/cloud-deploy.io/go-st/spec.go b/vendor/cloud-deploy.io/go-st/spec.go index e94fec3..a62d96f 100644 --- a/vendor/cloud-deploy.io/go-st/spec.go +++ b/vendor/cloud-deploy.io/go-st/spec.go @@ -143,9 +143,10 @@ type App struct { EveItemMetadata User string `json:"user"` - Name string `json:"name"` - Env string `json:"env"` - Role string `json:"role"` + Name string `json:"name"` + Env string `json:"env"` + Role string `json:"role"` + Description string `json:"description,omitempty"` Region string `json:"region"` InstanceType string `json:"instance_type"` From 6ca43048f1031acb8281698687ce4d28fb4d42f3 Mon Sep 17 00:00:00 2001 From: Jordan Caussat Date: Mon, 7 May 2018 10:46:17 +0200 Subject: [PATCH 2/3] TER-272: Update go-st vendor --- vendor/cloud-deploy.io/go-st/spec.go | 2 +- vendor/vendor.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/cloud-deploy.io/go-st/spec.go b/vendor/cloud-deploy.io/go-st/spec.go index a62d96f..e9340e2 100644 --- a/vendor/cloud-deploy.io/go-st/spec.go +++ b/vendor/cloud-deploy.io/go-st/spec.go @@ -146,7 +146,7 @@ type App struct { Name string `json:"name"` Env string `json:"env"` Role string `json:"role"` - Description string `json:"description,omitempty"` + Description string `json:"description"` Region string `json:"region"` InstanceType string `json:"instance_type"` diff --git a/vendor/vendor.json b/vendor/vendor.json index 754c2ad..e35a8ae 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,10 +3,10 @@ "ignore": "test", "package": [ { - "checksumSHA1": "1+7geaq6oHievNI7XMK7SNE5rbo=", + "checksumSHA1": "B7yGeS9brb/atzVIEx3v02G0PX0=", "path": "cloud-deploy.io/go-st", - "revision": "94578fa223acca309d2d2ff98637dff1ff5391a5", - "revisionTime": "2018-04-10T08:10:15Z" + "revision": "031c26acdfeb5d31ce030f7992fa6aac3b84404f", + "revisionTime": "2018-05-07T07:48:28Z" }, { "checksumSHA1": "jQh1fnoKPKMURvKkpdRjN695nAQ=", From d8c5adfadcba39e7b5e1f6bbe8e5ca7ff48ecafa Mon Sep 17 00:00:00 2001 From: Jordan Caussat Date: Mon, 7 May 2018 11:39:56 +0200 Subject: [PATCH 3/3] TER-272: Fix spacing --- ghost/resource_ghost_app_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ghost/resource_ghost_app_test.go b/ghost/resource_ghost_app_test.go index a72d6aa..2509bc9 100644 --- a/ghost/resource_ghost_app_test.go +++ b/ghost/resource_ghost_app_test.go @@ -112,9 +112,9 @@ func testAccCheckGhostAppDestroy(s *terraform.State) error { func testAccGhostAppConfig(name string) string { return fmt.Sprintf(` resource "ghost_app" "test" { - name = "%s" - env = "dev" - role = "webfront" + name = "%s" + env = "dev" + role = "webfront" description = "This is a test" region = "eu-west-1" @@ -182,10 +182,10 @@ func testAccGhostAppConfig(name string) string { name = "php5" }, { - version = "" - name = "package" + version = "" + name = "package" provisioner = "ansible" - parameters = <