Skip to content
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

Update Vercel project name and TFC organization name #31

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 pulls request with Terraform outputs
- name: Create comment with Terraform output
uses: actions/[email protected]
if: github.event_name == 'pull_request' && github.event.action != 'closed'
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
cloud {
hostname = "app.terraform.io"
organization = "hashicorp-training"
organization = "pyther-organization"
workspaces {
tags = ["hashicupsBackend"]
}
Expand All @@ -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 Load Balancer"
default = false
}

Expand Down
4 changes: 2 additions & 2 deletions preview-env/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data "terraform_remote_state" "shared" {
backend = "remote"

config = {
organization = "hashicorp-training"
organization = "pyther-organization"
workspaces = {
name = "hcup-be-shared"
}
Expand All @@ -26,7 +26,7 @@ data "aws_ami" "ubuntu" {
values = ["hvm"]
}

owners = ["099720109477"] # Canonical
owners = ["099720109477"] # Canonicals
}

data "template_file" "user_data" {
Expand Down
2 changes: 1 addition & 1 deletion preview-env/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion preview-env/vercel.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 s
resource "vercel_deployment" "frontend" {
project_id = data.terraform_remote_state.shared.outputs.vercel_project_id
files = data.vercel_project_directory.frontend.files
Expand Down
1 change: 1 addition & 0 deletions src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default function Header(props) {
<div className="absolute left-0 top-0">
<Image src="/images/demo.svg" height={88} width={88} />
</div>
<h1 class="font-bold py-4 ">HashiCups</h1>
</header>

<Account accountVisible={props.accountVisible} setAccountVisible={props.setAccountVisible} isAuthed={props.isAuthed} setIsAuthed={props.setIsAuthed} username={props.username} setUsername={props.setUsername} token={props.token} setToken={props.setToken} />
Expand Down