Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunSu1768 committed May 15, 2024
2 parents 99e15ab + 762dbfd commit 506eb29
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/add_domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Add ecr
- name: Add Domain
shell: bash
run: |
echo ${{ github.event.client_payload.domain }}
location=$(grep -n "# XQUARE_REPOSITORY_NAME" ecr.tf | cut -d ":" -f 1)
domain_name=$(echo "${{ github.event.client_payload.domain }}" | sed 's/\..*//')
location=$(grep -n "# DOMAIN_NAME" cloudflare.tf | cut -d ":" -f 1)
if [ -n "$location" ]; then
sed -i "${location}s|.*|&\n \"${{ github.event.client_payload.domain }}\",|" cloudflare.tf
sed -i "${location}s|.*|&\n \"$domain_name\",|" cloudflare.tf
fi
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}

- name: Terraform init
shell: bash
run: terraform init

- name: Terraform import
shell: bash
run: |
terraform import -var 'cloudflare_api_token=${{ env.CLOUDFLARE_API_TOKEN }}' \
cloudflare_record.xquare_server_record ${{ env.CLOUDFLARE_ZONE_ID }}
- name: Commit with new ECR
- name: Commit with new Domain
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "🔀 :: domain [${{ github.event.client_payload.domain }}] 추가"
Expand Down
2 changes: 1 addition & 1 deletion cloudflare.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ locals {
xquare_mysql_record_name = "mysql"
xquare_redis_record_name = "redis"
xquare_server_record_names = [
# XQUARE_REPOSITORY_NAME
# DOMAIN_NAME
"admin",
"api-chitchat",
"argo-cd",
Expand Down
5 changes: 5 additions & 0 deletions ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ locals {
name_prefix_v3 = "xquare-v3"
ecr_names = [
# ECR_REPOSITORY_NAME
"repo-user-fe-prod",
"repo-admin-fe-prod",
"repo-main-fe-prod",
"pick-teacher-fe-prod",
"pick-admin-fe-prod",
"envoy-middlware-be-prod",
"scul-main-fe-prod",
"xquare-infra-be-prod",
Expand Down

0 comments on commit 506eb29

Please sign in to comment.