Skip to content

Commit

Permalink
SB-05:fix:updated aws and azure configuration in github/workflows/bui…
Browse files Browse the repository at this point in the history
…ld_and_deploy.yaml
  • Loading branch information
divyagovindaiah committed Oct 30, 2023
1 parent 2f91738 commit 05ecb90
Showing 1 changed file with 64 additions and 64 deletions.
128 changes: 64 additions & 64 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,73 +50,73 @@ jobs:
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/flink-command-service:${{ github.ref_name }}

aws-deploy:
needs: [check-tag, docker-build-api-service, docker-build-command-service]
if: needs.check-tag.outputs.ALLOWED_TAG == 'True'
runs-on: ubuntu-latest
environment: aws-dev
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terragrunt
uses: autero1/[email protected]
with:
terragrunt_version: v0.45.8
- name: Terragrunt installation
run: terragrunt --version
- name: Clone the terraform deployment repo
uses: actions/checkout@v3
with:
repository: ${{ vars.DEPLOY_REPO }}
path: deploy
ref: ${{ vars.DEPLOY_REPO_REF }}
# aws-deploy:
# needs: [check-tag, docker-build-api-service, docker-build-command-service]
# if: needs.check-tag.outputs.ALLOWED_TAG == 'True'
# runs-on: ubuntu-latest
# environment: aws-dev
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup Terragrunt
# uses: autero1/[email protected]
# with:
# terragrunt_version: v0.45.8
# - name: Terragrunt installation
# run: terragrunt --version
# - name: Clone the terraform deployment repo
# uses: actions/checkout@v3
# with:
# repository: ${{ vars.DEPLOY_REPO }}
# path: deploy
# ref: ${{ vars.DEPLOY_REPO_REF }}

- name: Fetch and update kubeconfig file
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ vars.AWS_REGION }}
run: |
aws eks --region ${{ vars.AWS_REGION }} update-kubeconfig --name ${{ vars.KUBERNETES_CLUSTER_NAME }}
# - name: Fetch and update kubeconfig file
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: ${{ vars.AWS_REGION }}
# run: |
# aws eks --region ${{ vars.AWS_REGION }} update-kubeconfig --name ${{ vars.KUBERNETES_CLUSTER_NAME }}


- name: Run terraform init and apply
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_TERRAFORM_BACKEND_BUCKET_NAME: ${{ vars.AWS_TERRAFORM_BACKEND_BUCKET_NAME }}
AWS_TERRAFORM_BACKEND_BUCKET_REGION: ${{ vars.AWS_TERRAFORM_BACKEND_BUCKET_REGION }}
KUBE_CONFIG_PATH: ~/.kube/config
# - name: Run terraform init and apply
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: ${{ vars.AWS_REGION }}
# AWS_TERRAFORM_BACKEND_BUCKET_NAME: ${{ vars.AWS_TERRAFORM_BACKEND_BUCKET_NAME }}
# AWS_TERRAFORM_BACKEND_BUCKET_REGION: ${{ vars.AWS_TERRAFORM_BACKEND_BUCKET_REGION }}
# KUBE_CONFIG_PATH: ~/.kube/config

run: |
cd deploy/terraform/aws
terragrunt init
terragrunt apply -auto-approve --target=module.dataset_api \
-var dataset_api_container_registry=${{ vars.DOCKERHUB_USERNAME }} \
-var dataset_api_image_tag=${{ github.ref_name }}
# run: |
# cd deploy/terraform/aws
# terragrunt init
# terragrunt apply -auto-approve --target=module.dataset_api \
# -var dataset_api_container_registry=${{ vars.DOCKERHUB_USERNAME }} \
# -var dataset_api_image_tag=${{ github.ref_name }}

azure-deploy:
needs: [check-tag, docker-build-api-service, docker-build-command-service]
if: needs.check-tag.outputs.ALLOWED_TAG == 'True' && vars.CLOUD_PROVIDER == 'azure'
runs-on: ubuntu-latest
steps:
- name: Clone the terraform deployment repo
uses: actions/checkout@v3
with:
repository: ${{ vars.DEPLOY_REPO }}
path: deploy
ref: ${{ vars.DEPLOY_REPO_REF }}
# azure-deploy:
# needs: [check-tag, docker-build-api-service, docker-build-command-service]
# if: needs.check-tag.outputs.ALLOWED_TAG == 'True' && vars.CLOUD_PROVIDER == 'azure'
# runs-on: ubuntu-latest
# steps:
# - name: Clone the terraform deployment repo
# uses: actions/checkout@v3
# with:
# repository: ${{ vars.DEPLOY_REPO }}
# path: deploy
# ref: ${{ vars.DEPLOY_REPO_REF }}

- name: Run terraform init and apply
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
run: |
cd deploy/terraform/azure
terragrunt init
terragrunt apply -auto-approve --target=module.dataset_api \
-var dataset_api_container_registry=${{ secrets.DOCKERHUB_USERNAME }} \
-var dataset_api_image_tag=${{ github.ref_name }}
# - name: Run terraform init and apply
# env:
# ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
# ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
# ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
# ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
# run: |
# cd deploy/terraform/azure
# terragrunt init
# terragrunt apply -auto-approve --target=module.dataset_api \
# -var dataset_api_container_registry=${{ secrets.DOCKERHUB_USERNAME }} \
# -var dataset_api_image_tag=${{ github.ref_name }}

0 comments on commit 05ecb90

Please sign in to comment.