From 84161e36a421955d2546eacd77e59f76269bfdcd Mon Sep 17 00:00:00 2001 From: kark2022 Date: Mon, 19 Jun 2023 13:25:29 -0400 Subject: [PATCH 1/5] Update Vercel project name and TFC organization name --- .github/workflows/vercel.yml | 2 +- main.tf | 2 +- preview-env/main.tf | 2 +- preview-env/variables.tf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml index 384a83e..3248d84 100644 --- a/.github/workflows/vercel.yml +++ b/.github/workflows/vercel.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: tfcWorkspaceName: hcup-be-${{ github.head_ref }} - tfcOrg: hashicorp-training + tfcOrg: pyther-organization steps: - name: Checkout uses: actions/checkout@v2 diff --git a/main.tf b/main.tf index 2ac4bbf..a000c13 100644 --- a/main.tf +++ b/main.tf @@ -1,7 +1,7 @@ terraform { cloud { hostname = "app.terraform.io" - organization = "hashicorp-training" + organization = "pyther-organization" workspaces { tags = ["hashicupsBackend"] } diff --git a/preview-env/main.tf b/preview-env/main.tf index 1ed96d2..9e2ac48 100644 --- a/preview-env/main.tf +++ b/preview-env/main.tf @@ -6,7 +6,7 @@ data "terraform_remote_state" "shared" { backend = "remote" config = { - organization = "hashicorp-training" + organization = "pyther-organization" workspaces = { name = "hcup-be-shared" } diff --git a/preview-env/variables.tf b/preview-env/variables.tf index 434696f..8d539d2 100644 --- a/preview-env/variables.tf +++ b/preview-env/variables.tf @@ -5,7 +5,7 @@ variable "environment_tag" { variable "region" { description = "The region Terraform deploys your instance" - default = "us-east-2" + default = "us-east-1" } variable "is_prod" { From 62df72038ee87aaad0a04b09505f8ed7399520c3 Mon Sep 17 00:00:00 2001 From: kark2022 Date: Mon, 19 Jun 2023 13:44:56 -0400 Subject: [PATCH 2/5] Add HashiCups to header --- src/components/Header.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Header.js b/src/components/Header.js index ba56f02..a1ac066 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -59,6 +59,7 @@ export default function Header(props) {
+

HashiCups

From f7c13be969bbf93193fed32352921c240a507415 Mon Sep 17 00:00:00 2001 From: kark2022 Date: Mon, 19 Jun 2023 22:57:00 -0400 Subject: [PATCH 3/5] Update Vercel project name and TFC organization names --- .github/workflows/vercel.yml | 6 +++--- main.tf | 2 +- preview-env/vercel.tf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml index 3248d84..010a7ce 100644 --- a/.github/workflows/vercel.yml +++ b/.github/workflows/vercel.yml @@ -29,20 +29,20 @@ jobs: run: | sed -i 's/tags = \["hashicupsBackend"\]/name = "'$tfcWorkspaceName'"/g' main.tf terraform init -input=false - # Builds and deploys backend + Vercel preview environments + # Builds and deploys backend and Vercel preview environments - name: Build and deploy preview environment if: github.event_name == 'pull_request' && github.event.action != 'closed' id: build-deploy-preview-environment run: | terraform apply --auto-approve - # Runs Terraform output to display the backend URL and Vercel preview URL + # Runs Terraform outputs to display the backend URL and Vercel preview URL - name: Terraform Output id: output if: github.event_name == 'pull_request' && github.event.action != 'closed' run: | terraform output -no-color continue-on-error: true - # Creates comments on pull request with Terraform output + # Creates comments on pull request with Terraform outputs - name: Create comment with Terraform output uses: actions/github-script@0.9.0 if: github.event_name == 'pull_request' && github.event.action != 'closed' diff --git a/main.tf b/main.tf index a000c13..f9dac04 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,7 @@ terraform { } variable "is_prod" { - description = "If false, deploys preview environment EC2 and LB" + description = "If false, deploys preview environment EC2 and LBalancer" default = false } diff --git a/preview-env/vercel.tf b/preview-env/vercel.tf index 142efc3..6d8c0ff 100644 --- a/preview-env/vercel.tf +++ b/preview-env/vercel.tf @@ -5,7 +5,7 @@ data "vercel_project_directory" "frontend" { locals { public_api_url = length(aws_lb.app) > 0 ? "https://${aws_lb.app[0].dns_name}" : "" } - + # create the deployment resource "vercel_deployment" "frontend" { project_id = data.terraform_remote_state.shared.outputs.vercel_project_id files = data.vercel_project_directory.frontend.files From 5667787b8f38036d42567aa55d2fabb519033160 Mon Sep 17 00:00:00 2001 From: kark2022 Date: Mon, 19 Jun 2023 23:18:43 -0400 Subject: [PATCH 4/5] a change has done --- .github/workflows/vercel.yml | 6 +++--- main.tf | 2 +- preview-env/main.tf | 2 +- preview-env/vercel.tf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vercel.yml b/.github/workflows/vercel.yml index 010a7ce..1099494 100644 --- a/.github/workflows/vercel.yml +++ b/.github/workflows/vercel.yml @@ -42,7 +42,7 @@ jobs: run: | terraform output -no-color continue-on-error: true - # Creates comments on pull request with Terraform outputs + # Creates comments on pulls request with Terraform outputs - name: Create comment with Terraform output uses: actions/github-script@0.9.0 if: github.event_name == 'pull_request' && github.event.action != 'closed' @@ -69,8 +69,8 @@ jobs: run: | terraform destroy --auto-approve curl --header "Authorization: Bearer ${{ secrets.TFC_API_TOKEN }}" --header "Content-Type: application/vnd.api+json" --request DELETE "https://app.terraform.io/api/v2/organizations/${tfcOrg}/workspaces/${tfcWorkspaceName}" - # Builds and deploys production environment, similar to preview environment but isProd is set to true - # This builds the production environment and does not build any accompanying backend preview resources + # Builds and deploys production environments, similar to preview environment but isProd is set to true + # This builds the productions environments and does not build any accompanying backend preview resources - name: Build and deploy Prod Environment id: build-deploy-prod-environment if: github.ref == 'refs/heads/main' && github.event_name == 'push' diff --git a/main.tf b/main.tf index f9dac04..d905b56 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,7 @@ terraform { } variable "is_prod" { - description = "If false, deploys preview environment EC2 and LBalancer" + description = "If false, deploys preview environment EC2 and Load Balancer" default = false } diff --git a/preview-env/main.tf b/preview-env/main.tf index 9e2ac48..d704fd8 100644 --- a/preview-env/main.tf +++ b/preview-env/main.tf @@ -26,7 +26,7 @@ data "aws_ami" "ubuntu" { values = ["hvm"] } - owners = ["099720109477"] # Canonical + owners = ["099720109477"] # Canonicals } data "template_file" "user_data" { diff --git a/preview-env/vercel.tf b/preview-env/vercel.tf index 6d8c0ff..047fab7 100644 --- a/preview-env/vercel.tf +++ b/preview-env/vercel.tf @@ -5,7 +5,7 @@ data "vercel_project_directory" "frontend" { locals { public_api_url = length(aws_lb.app) > 0 ? "https://${aws_lb.app[0].dns_name}" : "" } - # create the deployment + # create the deployment s resource "vercel_deployment" "frontend" { project_id = data.terraform_remote_state.shared.outputs.vercel_project_id files = data.vercel_project_directory.frontend.files From 4181d548aa8035a867c943d658cc88dcb1e4ce83 Mon Sep 17 00:00:00 2001 From: kark2022 Date: Mon, 19 Jun 2023 23:44:14 -0400 Subject: [PATCH 5/5] Add HashiCups to header --- src/components/Header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header.js b/src/components/Header.js index a1ac066..ac4da63 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -59,7 +59,7 @@ export default function Header(props) {
-

HashiCups

+

HashiCups