-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable source control management as option for user to deploy web apps #826
Changes from 2 commits
21db11c
78f5d92
e0cd2e8
180fd76
234b56f
834c914
749960e
6437f64
0765cf6
5ed289f
cc4de93
f3c7cd7
88714a9
423ffc1
bbba70f
d53a029
5384229
3c1cf85
1c4e460
ad47fdb
2d0fbf8
d0d7ab5
1ba5381
4860923
2efd09c
43b5b49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -582,6 +582,27 @@ func TestAccAzureRMAppService_webSockets(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAzureRMAppService_scmType(t *testing.T) { | ||
resourceName := "azurerm_app_service.test" | ||
ri := acctest.RandInt() | ||
config := testAccAzureRMAppService_scmType(ri, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMAppServiceDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMAppServiceExists(resourceName), | ||
resource.TestCheckResourceAttr(resourceName, "site_config.0.scm_type", "LocalGit"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testCheckAzureRMAppServiceDestroy(s *terraform.State) error { | ||
client := testAccProvider.Meta().(*ArmClient).appServicesClient | ||
|
||
|
@@ -689,7 +710,7 @@ resource "azurerm_app_service" "test" { | |
resource_group_name = "${azurerm_resource_group.test.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
site_config { | ||
use_32_bit_worker_process = true | ||
use_32_bit_worker_process = true | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -719,7 +740,7 @@ resource "azurerm_app_service" "test" { | |
resource_group_name = "${azurerm_resource_group.test.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
site_config { | ||
use_32_bit_worker_process = true | ||
use_32_bit_worker_process = true | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -750,7 +771,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
always_on = true | ||
always_on = true | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -781,7 +802,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
use_32_bit_worker_process = true | ||
use_32_bit_worker_process = true | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -812,7 +833,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
app_settings { | ||
"foo" = "bar" | ||
"foo" = "bar" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -871,9 +892,9 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
connection_string { | ||
name = "Example" | ||
value = "some-postgresql-connection-string" | ||
type = "PostgreSQL" | ||
name = "Example" | ||
value = "some-postgresql-connection-string" | ||
type = "PostgreSQL" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -904,11 +925,11 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
default_documents = [ | ||
"first.html", | ||
"second.jsp", | ||
"third.aspx", | ||
] | ||
default_documents = [ | ||
"first.html", | ||
"second.jsp", | ||
"third.aspx", | ||
] | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -967,7 +988,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
local_mysql_enabled = true | ||
local_mysql_enabled = true | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -998,7 +1019,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
managed_pipeline_mode = "Classic" | ||
managed_pipeline_mode = "Classic" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -1034,7 +1055,7 @@ resource "azurerm_app_service" "test" { | |
} | ||
|
||
tags { | ||
"Hello" = "World" | ||
"Hello" = "World" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -1065,7 +1086,7 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
tags { | ||
"Hello" = "World" | ||
"Hello" = "World" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -1096,8 +1117,8 @@ resource "azurerm_app_service" "test" { | |
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
tags { | ||
"Hello" = "World" | ||
"Terraform" = "AcceptanceTests" | ||
"Hello" = "World" | ||
"Terraform" = "AcceptanceTests" | ||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
|
@@ -1259,3 +1280,34 @@ resource "azurerm_app_service" "test" { | |
} | ||
`, rInt, location, rInt, rInt) | ||
} | ||
|
||
func testAccAzureRMAppService_scmType(rInt int, location string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" | ||
location = "%s" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aligning at '='? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
} | ||
|
||
resource "azurerm_app_service_plan" "test" { | ||
name = "acctestASP-%d" | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
|
||
sku { | ||
tier = "Standard" | ||
size = "S1" | ||
} | ||
} | ||
|
||
resource "azurerm_app_service" "test" { | ||
name = "acctestAS-%d" | ||
location = "${azurerm_resource_group.test.location}" | ||
resource_group_name = "${azurerm_resource_group.test.name}" | ||
app_service_plan_id = "${azurerm_app_service_plan.test.id}" | ||
|
||
site_config { | ||
scm_type = "LocalGit" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reduce spaces here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. |
||
} | ||
} | ||
`, rInt, location, rInt, rInt) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ resource "azurerm_app_service" "test" { | |
|
||
site_config { | ||
dotnet_framework_version = "v4.0" | ||
scm_type = "LocalGit" | ||
} | ||
|
||
app_settings { | ||
|
@@ -97,6 +98,7 @@ resource "azurerm_app_service" "test" { | |
java_version = "1.8" | ||
java_container = "JETTY" | ||
java_container_version = "9.3" | ||
scm_type = "LocalGit" | ||
} | ||
} | ||
``` | ||
|
@@ -160,6 +162,8 @@ The following arguments are supported: | |
|
||
* `websockets_enabled` - (Optional) Should WebSockets be enabled? | ||
|
||
* `scm_type` - (Optional) The Source Control Management Type. Possible values are `None` and `LocalGit`. Defaults to `None`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest we change this to:
and add a blue info box below it - stating the other types are coming soon
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good suggestion. |
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it'd also be good to expose the value of the SCM URL as a computed field - which I believe should be returned from the
GetSourceControl
API call when this is set toScmTypeLocalGit
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminding, this is exactly what I did the recent commit, please see changes.