Skip to content

Commit

Permalink
TER-235: Fix typo in readme, example and app test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Caussat committed Mar 20, 2018
1 parent 80695ac commit fcd5697
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 190 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ provider "ghost" {
}
resource "ghost_app" "test" {
name = "%s"
name = "wordpress"
env = "dev"
role = "webfront"
Expand Down
2 changes: 1 addition & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provider "ghost" {
}

resource "ghost_app" "test" {
name = "%s"
name = "wordpress"
env = "dev"
role = "webfront"

Expand Down
190 changes: 2 additions & 188 deletions ghost/resource_ghost_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ func TestAccGhostAppBasic(t *testing.T) {
testAccCheckGhostAppExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", envName),
resource.TestCheckResourceAttr(resourceName, "env", "dev"),
resource.TestCheckResourceAttr(resourceName, "region", "eu-west-1"),
),
},
{
Config: testAccGhostAppConfigUpdated(envName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckGhostAppExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", envName),
resource.TestCheckResourceAttr(resourceName, "env", "dev"),
resource.TestCheckResourceAttr(resourceName, "region", "eu-west-2"),
),
},
},
Expand Down Expand Up @@ -68,7 +58,7 @@ func testAccGhostAppConfig(name string) string {
resource "ghost_app" "test" {
name = "%s"
env = "dev"
role = "web-front_"
role = "webfront"
region = "eu-west-1"
instance_type = "t2.micro"
Expand Down Expand Up @@ -125,7 +115,7 @@ func testAccGhostAppConfig(name string) string {
name = "wordpress2"
pre_deploy = "ZXhpdCAx"
post_deploy = "ZXhpdCAx"
path = "/var/www-test.test_ew"
path = "/var/www-test.test"
scope = "code"
git_repo = "https://github.com/KnpLabs/KnpIpsum.git"
}]
Expand All @@ -151,179 +141,3 @@ func testAccGhostAppConfig(name string) string {
}
`, name)
}

func testAccGhostAppConfigUpdated(name string) string {
return fmt.Sprintf(`
resource "ghost_app" "test" {
name = "%s"
env = "dev"
role = "webfront"
region = "eu-west-2"
instance_type = "t2.micro"
vpc_id = "vpc-3f1eb65a"
log_notifications = [
"[email protected]",
]
build_infos = {
subnet_id = "subnet-a7e849fe"
ssh_username = "admin"
source_ami = "ami-03ce4474"
}
environment_infos = {
instance_profile = "iam.ec2.demo"
key_name = "ghost-demo"
root_block_device = {
name = "testblockdevice"
size = 20
}
optional_volumes = [{
device_name = "/dev/xvdd"
volume_type = "gp2"
volume_size = 20
}]
subnet_ids = ["subnet-a7e849fe"]
security_groups = ["sg-6814f60c"]
instance_tags = [{
tag_name = "Name"
tag_value = "wordpress"
},
{
tag_name = "Type"
tag_value = "front"
}]
}
autoscale = {
name = "autoscale"
min = 1
max = 2
}
modules = [{
name = "wordpress"
pre_deploy = ""
path = "/var/www"
scope = "code"
git_repo = "https://github.com/KnpLabs/KnpIpsum.git"
},
{
name = "wordpress2"
pre_deploy = "ZXhpdCAx"
post_deploy = "ZXhpdCAx"
path = "/var/www"
scope = "code"
git_repo = "https://github.com/KnpLabs/KnpIpsum.git"
}]
features = [{
version = "5.4"
name = "php5"
},
{
version = "2.2"
name = "apache2"
}]
lifecycle_hooks = {
pre_buildimage = "#!/usr/bin/env bash"
}
environment_variables = [{
key = "myvar2"
value = "myvalue2"
}]
}
`, name)
}

func testAccGhostAppConfigOmitEmpty(name string) string {
return fmt.Sprintf(`
resource "ghost_app" "test" {
name = "%s"
env = "dev"
role = "webfront"
region = "eu-west-2"
instance_type = "t2.micro"
vpc_id = "vpc-3f1eb65a"
log_notifications = [
"[email protected]",
]
build_infos = {
subnet_id = "subnet-a7e849fe"
ssh_username = "admin"
source_ami = "ami-03ce4474"
}
environment_infos = {
instance_profile = "iam.ec2.demo"
key_name = "ghost-demo"
root_block_device = {
name = "testblockdevice"
size = 20
}
optional_volumes = [{
device_name = "data"
volume_type = "lol"
volume_size = 20
}]
subnet_ids = ["subnet-a7e849fe"]
security_groups = ["sg-6814f60c"]
instance_tags = [{
tag_name = "Name"
tag_value = "wordpress"
},
{
tag_name = "Type"
tag_value = "front"
}]
}
autoscale = {
name = "autoscale"
min = 0
max = 2
}
modules = [{
name = "wordpress"
pre_deploy = ""
path = "/var/www"
scope = "code"
git_repo = "https://github.com/KnpLabs/KnpIpsum.git"
},
{
name = "wordpress2"
pre_deploy = "ZXhpdCAx"
post_deploy = "ZXhpdCAx"
path = "/var/www"
scope = "code"
git_repo = "https://github.com/KnpLabs/KnpIpsum.git"
}]
features = [{
version = "5.4"
name = "php5"
},
{
version = "2.2"
name = "apache2"
}]
lifecycle_hooks = {
pre_buildimage = "#!/usr/bin/env bash"
}
environment_variables = [{
key = "myvar2"
value = "myvalue2"
}]
}
`, name)
}

0 comments on commit fcd5697

Please sign in to comment.