From 506eb40d56dde4bbf7c8d48245fb74c12a7d3312 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 9 May 2019 13:41:42 -0400 Subject: [PATCH 1/3] remove name argument for github_repository_webhook --- website/deploy/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/website/deploy/main.tf b/website/deploy/main.tf index ce650f1fa..355172679 100644 --- a/website/deploy/main.tf +++ b/website/deploy/main.tf @@ -26,7 +26,6 @@ resource "github_repository_deploy_key" "key" { // Create a webhook that triggers Netlify builds on push. resource "github_repository_webhook" "main" { repository = "${local.github_repo}" - name = "web" events = ["delete", "push", "pull_request"] configuration { From c9665b7a9da8edc59b5b8431b7206eb109d81396 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 9 May 2019 13:54:23 -0400 Subject: [PATCH 2/3] set insecure_ssl and a custom site domain --- website/deploy/main.tf | 4 +++- website/deploy/variables.tf | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/website/deploy/main.tf b/website/deploy/main.tf index 355172679..cb29badd0 100644 --- a/website/deploy/main.tf +++ b/website/deploy/main.tf @@ -31,6 +31,7 @@ resource "github_repository_webhook" "main" { configuration { content_type = "json" url = "https://api.netlify.com/hooks/github" + insecure_ssl = false } depends_on = ["netlify_site.main"] @@ -46,7 +47,8 @@ Netlify Resources resource "netlify_deploy_key" "key" {} resource "netlify_site" "main" { - name = "${var.name}" + name = "${var.name}" + custom_domain = "${var.custom_site_domain}" repo { repo_branch = "${var.github_branch}" diff --git a/website/deploy/variables.tf b/website/deploy/variables.tf index 087738341..3fcee45c5 100644 --- a/website/deploy/variables.tf +++ b/website/deploy/variables.tf @@ -12,3 +12,8 @@ variable "github_branch" { default = "stable-website" description = "GitHub branch which netlify will continuously deploy." } + +variable "custom_site_domain" { + default = "packer.io" + description = "The custom domain to use for the Netlify site." +} \ No newline at end of file From e40943ef8f20a866813284dbee6c6338dfcbc9ce Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 9 May 2019 14:21:26 -0400 Subject: [PATCH 3/3] pin github and netlify providers --- website/deploy/main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/deploy/main.tf b/website/deploy/main.tf index cb29badd0..74441e1b2 100644 --- a/website/deploy/main.tf +++ b/website/deploy/main.tf @@ -13,6 +13,8 @@ GitHub Resources provider "github" { organization = "${local.github_org}" + + version = "~> 2.0.0" } // Configure the repository with the dynamically created Netlify key. @@ -43,6 +45,10 @@ Netlify Resources ------------------------------------------------------------------- */ +provider "netlify" { + version = "~> 0.1.0" +} + // A new, unique deploy key for this specific website resource "netlify_deploy_key" "key" {}