Skip to content

Commit

Permalink
Merge pull request #997 from AlexsLemonade/dev
Browse files Browse the repository at this point in the history
Production Deploy
  • Loading branch information
davidsmejia authored Nov 22, 2024
2 parents e8ce28b + beb19d5 commit 79dc821
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 0.13.0
terraform_version: 0.14.0

- name: Deploy
run: cd infrastructure && python3 deploy.py -e prod -u deployer -d ccdl -v $(git rev-parse HEAD)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_staging_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 0.13.0
terraform_version: 0.14.0

- name: Deploy
run: cd infrastructure && python3 deploy.py -e staging -u deployer -d ccdlstaging -v $(git rev-parse HEAD)
Expand Down
8 changes: 1 addition & 7 deletions infrastructure/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import time

from init_terraform import init_terraform
from replace_provider import replace_provider

PRIVATE_KEY_FILE_PATH = "scpca-portal-key.pem"
PUBLIC_KEY_FILE_PATH = "scpca-portal-key.pub"
Expand Down Expand Up @@ -241,17 +240,12 @@ def restart_api_if_still_running(args, api_ip_address):
if init_code != 0:
exit(init_code)

replace_provider_code = replace_provider("hashicorp", "aws")

if replace_provider_code != 0:
exit(replace_provider_code)

terraform_code, terraform_output = run_terraform(args)
if terraform_code != 0:
exit(terraform_code)

ip_address_match = re.match(
r".*\napi_server_1_ip = (\d+\.\d+\.\d+\.\d+)\n.*", terraform_output, re.DOTALL
r".*\napi_server_1_ip = \"(\d+\.\d+\.\d+\.\d+)\"\n.*", terraform_output, re.DOTALL
)

if ip_address_match:
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
# version = "~> 5.0.0"
}
}
required_version = "0.13.0"
required_version = "0.14.0"
}

provider "aws" {
Expand Down

0 comments on commit 79dc821

Please sign in to comment.