-
Notifications
You must be signed in to change notification settings - Fork 0
Initial PR for Zoho API Integration - Requesting Feedback on API Code and Deployment Files #1
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
Open
parthdande
wants to merge
8
commits into
dev
Choose a base branch
from
zoho_api
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8e1ae2b
initial commit
parthdande 40d5108
add swagger docs / remove debug statement
parthdande 54a5810
Add Redis configuration and update deployment settings
parthdande 3b14d84
resolved requested changes from PR
parthdande ac223fb
style: minor formatting updates
parthdande cc148b5
Remove hardcoded port info from entrypoint
parthdande 9135145
namechange variable remodel_id to entity_id and comments added
parthdande 9861894
codebase documentation and readme file added
parthdande File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| name: Build and Deploy to Cloud Run | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - dev | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| env: | ||
| environment: dev | ||
|
|
||
| jobs: | ||
|
|
||
| setup-infra: | ||
| uses: FutureRemodelAI/remodelai-infrastructure/.github/workflows/terraform.yml@main | ||
| with: | ||
| environment: dev | ||
| github_branch: ${{ github.ref_name }} | ||
| github_org: ${{ github.repository_owner }} | ||
| github_repo: ${{ github.event.repository.name }} | ||
| secrets: inherit | ||
|
|
||
| read-infra-outputs: | ||
| needs: setup-infra | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| artifact_registry_url: ${{ steps.parse.outputs.artifact_registry_url }} | ||
| pool_full_path: ${{ steps.parse.outputs.pool_full_path }} | ||
| github_secrets_sa: ${{ steps.parse.outputs.github_secrets_sa }} | ||
| github_builder_sa: ${{ steps.parse.outputs.github_builder_sa }} | ||
| github_deployer_sa: ${{ steps.parse.outputs.github_deployer_sa }} | ||
| created_subdomain: ${{ steps.parse.outputs.created_subdomain }} | ||
| github_dns_sa: ${{ steps.parse.outputs.github_dns_sa }} | ||
| steps: | ||
| - name: Download Terraform Output Artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: terraform-outputs | ||
|
|
||
| - name: Read and Export Outputs | ||
| id: parse | ||
| run: | | ||
| data=$(cat infra-outputs.json) | ||
| echo "artifact_registry_url=$(echo $data | jq -r '.artifact_registry_url')" >> $GITHUB_OUTPUT | ||
| echo "pool_full_path=$(echo $data | jq -r '.pool_full_path')" >> $GITHUB_OUTPUT | ||
| echo "github_secrets_sa=$(echo $data | jq -r '.github_secrets_sa')" >> $GITHUB_OUTPUT | ||
| echo "github_builder_sa=$(echo $data | jq -r '.github_builder_sa')" >> $GITHUB_OUTPUT | ||
| echo "github_deployer_sa=$(echo $data | jq -r '.github_deployer_sa')" >> $GITHUB_OUTPUT | ||
| echo "created_subdomain=$(echo $data | jq -r '.created_subdomain')" >> $GITHUB_OUTPUT | ||
| echo "github_dns_sa=$(echo $data | jq -r '.github_dns_sa')" >> $GITHUB_OUTPUT | ||
|
|
||
| build-and-deploy: | ||
| needs: [setup-infra, read-infra-outputs] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| steps: | ||
| # Step 1: Check out the repository | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| # Step 3: Set up Python 11 | ||
| - name: Set up Python 11 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: 11 | ||
|
|
||
| # Step 4: Authenticate using Workload Identity Federation (for Secrets and Initial gcloud) | ||
| - name: Authenticate via WIF for Build | ||
| id: auth-build | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path }} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_secrets_sa}} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
|
||
| # Step 5: Pull Secrets from Google Secret Manager | ||
| - name: Fetch Secrets from Google Secret Manager | ||
| id: secrets | ||
| uses: google-github-actions/get-secretmanager-secrets@v2 | ||
| with: | ||
| export_to_environment: true | ||
| secrets: |- | ||
| DEV_CONNECTION_NAME:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONNECTION_NAME | ||
| DEV_DATABASE_NAME:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DATABASE_NAME | ||
| DEV_DB_PASSWORD:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_PASSWORD | ||
| DEV_DB_USER:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_USER | ||
| DEV_GUNICORN_WORKERS:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_GUNICORN_WORKERS | ||
| DEV_GUNICORN_BIND:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_GUNICORN_BIND | ||
| DEV_GUNICORN_WORKER_CLASS:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_GUNICORN_WORKER_CLASS | ||
| DEV_RATELIMIT_HEADERS_ENABLED:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_RATELIMIT_HEADERS_ENABLED | ||
| DEV_DEFAULT_RATELIMIT:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DEFAULT_RATELIMIT | ||
| DEV_CACHE_REDIS_USERNAME:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CACHE_REDIS_USERNAME | ||
| DEV_CACHE_REDIS_PASSWORD:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CACHE_REDIS_PASSWORD | ||
| DEV_CACHE_REDIS_HOST:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CACHE_REDIS_HOST | ||
| DEV_CACHE_REDIS_PORT:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CACHE_REDIS_PORT | ||
| ZOHO_CLIENT_SECRET:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/ZOHO_CLIENT_SECRET | ||
| ZOHO_CLIENT_ID:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/ZOHO_CLIENT_ID | ||
| - name: Map DEV-prefixed vars to generic names | ||
| run: | | ||
| vars=("CONNECTION_NAME" "DATABASE_NAME" "DB_PASSWORD" "DB_USER" "GUNICORN_WORKERS" "GUNICORN_BIND" "GUNICORN_WORKER_CLASS" "RATELIMIT_HEADERS_ENABLED" "DEFAULT_RATELIMIT" "CACHE_REDIS_USERNAME" "CACHE_REDIS_PASSWORD" "CACHE_REDIS_HOST" "CACHE_REDIS_PORT") | ||
| for var in "${vars[@]}"; do | ||
| secret_name="DEV_${var}" | ||
| echo "$var=${!secret_name}" >> $GITHUB_ENV | ||
| done | ||
|
|
||
| # Step 6: Authenticate using Workload Identity Federation for Build and Push | ||
|
|
||
| - name: Authenticate via WIF for Build and Push | ||
| id: auth-build-push | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_builder_sa }} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
| token_format: "access_token" | ||
| access_token_scopes: "https://www.googleapis.com/auth/cloud-platform" | ||
|
|
||
| - name: Re-configure Docker for Artifact Registry | ||
| run: gcloud auth configure-docker ${{secrets.GCP_PREFERRED_REGION}}-docker.pkg.dev --quiet | ||
| env: | ||
| CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: ${{ steps.auth-build-push.outputs.credentials_file_path }} | ||
| #install dependencies for application | ||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m venv venv | ||
| source venv/bin/activate | ||
| pip install -r requirements.txt | ||
| apt-get update && apt-get install -y \ | ||
| build-essential libpq-dev gcc netcat-openbsd \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| source venv/bin/activate | ||
| pytest | ||
|
|
||
| - name: Make entrypoint.sh executable | ||
| run: chmod +x entrypoint.sh | ||
|
|
||
| # Step 7: Build Docker image | ||
| - name: Build Docker image | ||
| run: | | ||
| docker build -t "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" . | ||
|
|
||
| # Step 9: Push Docker image | ||
| - name: Push Docker image | ||
| run: | | ||
| docker push "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" | ||
|
|
||
| # Step 10: Re-authenticate using Workload Identity Federation for Deployment | ||
| - name: Authenticate via WIF for Deployment | ||
| id: auth-deploy | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{ needs.read-infra-outputs.outputs.github_deployer_sa}} | ||
|
|
||
| # Step 11: Deploy to Cloud Run | ||
| - name: Deploy to Cloud Run | ||
| run: | | ||
| gcloud run deploy ${{env.environment}}-${{secrets.APP_NAME}}-api \ | ||
| --image "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" \ | ||
| --region ${{secrets.GCP_PREFERRED_REGION}} \ | ||
| --platform managed \ | ||
| --allow-unauthenticated \ | ||
| --add-cloudsql-instances="${DEV_CONNECTION_NAME}" \ | ||
| --set-secrets="DEV_CONNECTION_NAME=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONNECTION_NAME:latest,DEV_CONVERSATION_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONVERSATION_SERVICE_URL:latest,DEV_DATABASE_NAME=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DATABASE_NAME:latest,DEV_DB_PASSWORD=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_PASSWORD:latest,DEV_DB_USER=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_USER:latest,DEV_IDENTITY_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_IDENTITY_SERVICE_URL:latest,DEV_INVITATION_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_INVITATION_SERVICE_URL:latest,DEV_PAYMENT_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_PAYMENT_SERVICE_URL:latest,DEV_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_URL:latest" \ | ||
| --set-env-vars "SPRING_ACTIVE_PROFILE=${{env.environment}}" | ||
|
|
||
| #Step 12: Auth to attach the sub domain for the service | ||
| - name: Authenticate via WIF for DNS | ||
| id: auth-dns | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_dns_sa}} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
|
||
| # Step 13: Attach the subdomain to the Cloud Run service | ||
| - name: Attach subdomain to Cloud Run service | ||
| run: | | ||
| gcloud alpha run domain-mappings create \ | ||
| --service ${{ env.environment }}-${{ secrets.APP_NAME }}-api \ | ||
| --domain "${{ needs.read-infra-outputs.outputs.created_subdomain }}" \ | ||
| --region ${{ secrets.GCP_PREFERRED_REGION }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| name: Build and Deploy to Cloud Run | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - dev | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| env: | ||
| environment: prod | ||
|
|
||
| jobs: | ||
|
|
||
| setup-infra: | ||
| uses: FutureRemodelAI/remodelai-infrastructure/.github/workflows/terraform.yml@main | ||
| with: | ||
| environment: dev | ||
| github_branch: ${{ github.ref_name }} | ||
| github_org: ${{ github.repository_owner }} | ||
| github_repo: ${{ github.event.repository.name }} | ||
| secrets: inherit | ||
|
|
||
| read-infra-outputs: | ||
| needs: setup-infra | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| artifact_registry_url: ${{ steps.parse.outputs.artifact_registry_url }} | ||
| pool_full_path: ${{ steps.parse.outputs.pool_full_path }} | ||
| github_secrets_sa: ${{ steps.parse.outputs.github_secrets_sa }} | ||
| github_builder_sa: ${{ steps.parse.outputs.github_builder_sa }} | ||
| github_deployer_sa: ${{ steps.parse.outputs.github_deployer_sa }} | ||
| created_subdomain: ${{ steps.parse.outputs.created_subdomain }} | ||
| github_dns_sa: ${{ steps.parse.outputs.github_dns_sa }} | ||
| steps: | ||
| - name: Download Terraform Output Artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: terraform-outputs | ||
|
|
||
| - name: Read and Export Outputs | ||
| id: parse | ||
| run: | | ||
| data=$(cat infra-outputs.json) | ||
| echo "artifact_registry_url=$(echo $data | jq -r '.artifact_registry_url')" >> $GITHUB_OUTPUT | ||
| echo "pool_full_path=$(echo $data | jq -r '.pool_full_path')" >> $GITHUB_OUTPUT | ||
| echo "github_secrets_sa=$(echo $data | jq -r '.github_secrets_sa')" >> $GITHUB_OUTPUT | ||
| echo "github_builder_sa=$(echo $data | jq -r '.github_builder_sa')" >> $GITHUB_OUTPUT | ||
| echo "github_deployer_sa=$(echo $data | jq -r '.github_deployer_sa')" >> $GITHUB_OUTPUT | ||
| echo "created_subdomain=$(echo $data | jq -r '.created_subdomain')" >> $GITHUB_OUTPUT | ||
| echo "github_dns_sa=$(echo $data | jq -r '.github_dns_sa')" >> $GITHUB_OUTPUT | ||
|
|
||
| build-and-deploy: | ||
| needs: [setup-infra, read-infra-outputs] | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| steps: | ||
| # Step 1: Check out the repository | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| # Step 3: Set up Python 11 | ||
| - name: Set up Python 11 | ||
| uses: actions/setup-python@v3 | ||
| with: | ||
| python-version: 11 | ||
|
|
||
|
|
||
|
|
||
| # Step 4: Authenticate using Workload Identity Federation (for Secrets and Initial gcloud) | ||
| - name: Authenticate via WIF for Build | ||
| id: auth-build | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path }} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_secrets_sa}} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
|
||
| # Step 5: Pull Secrets from Google Secret Manager | ||
| - name: Fetch Secrets from Google Secret Manager | ||
| id: secrets | ||
| uses: google-github-actions/get-secretmanager-secrets@v2 | ||
| with: | ||
| export_to_environment: true | ||
| secrets: |- | ||
| DEV_CONNECTION_NAME:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONNECTION_NAME | ||
| DEV_CONVERSATION_SERVICE_URL:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONVERSATION_SERVICE_URL | ||
| DEV_DATABASE_NAME:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DATABASE_NAME | ||
| DEV_DB_PASSWORD:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_PASSWORD | ||
| DEV_DB_USER:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_USER | ||
| DEV_IDENTITY_SERVICE_URL:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_IDENTITY_SERVICE_URL | ||
| DEV_INVITATION_SERVICE_URL:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_INVITATION_SERVICE_URL | ||
| DEV_ORGANIZATION_ARTIFACT_REGISTRY_PATH:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_ORGANIZATION_ARTIFACT_REGISTRY_PATH | ||
| DEV_PAYMENT_SERVICE_URL:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_PAYMENT_SERVICE_URL | ||
| DEV_URL:projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_URL | ||
|
|
||
| # Step 6: Capture SPRING_ACTIVE_PROFILE from GitHub environment into the runner’s env | ||
| - name: Set SPRING_ACTIVE_PROFILE in runner environment | ||
| run: echo "SPRING_ACTIVE_PROFILE=dev" >> $GITHUB_ENV | ||
|
|
||
| # Step 7: Build the application | ||
| - name: Build the application | ||
| run: gunicorn -k eventlet -w 1 -b 0.0.0.0:8080 run:app | ||
|
|
||
| - name: Authenticate via WIF for Build and Push | ||
| id: auth-build-push | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_builder_sa }} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
| token_format: "access_token" | ||
| access_token_scopes: "https://www.googleapis.com/auth/cloud-platform" | ||
|
|
||
| - name: Re-configure Docker for Artifact Registry | ||
| run: gcloud auth configure-docker ${{secrets.GCP_PREFERRED_REGION}}-docker.pkg.dev --quiet | ||
| env: | ||
| CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE: ${{ steps.auth-build-push.outputs.credentials_file_path }} | ||
|
|
||
| # Step 8: Build Docker image | ||
| - name: Build Docker image | ||
| run: | | ||
| docker build -t "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" . | ||
|
|
||
| # Step 9: Push Docker image | ||
| - name: Push Docker image | ||
| run: | | ||
| docker push "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" | ||
|
|
||
| # Step 10: Re-authenticate using Workload Identity Federation for Deployment | ||
| - name: Authenticate via WIF for Deployment | ||
| id: auth-deploy | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{ needs.read-infra-outputs.outputs.github_deployer_sa}} | ||
|
|
||
| # Step 11: Deploy to Cloud Run | ||
| - name: Deploy to Cloud Run | ||
| run: | | ||
| gcloud run deploy ${{env.environment}}-${{secrets.APP_NAME}}-api \ | ||
| --image "${{needs.read-infra-outputs.outputs.artifact_registry_url}}/${{env.environment}}-${{secrets.APP_NAME}}-api:latest" \ | ||
| --region ${{secrets.GCP_PREFERRED_REGION}} \ | ||
| --platform managed \ | ||
| --allow-unauthenticated \ | ||
| --add-cloudsql-instances="${DEV_CONNECTION_NAME}" \ | ||
| --set-secrets="DEV_CONNECTION_NAME=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONNECTION_NAME:latest,DEV_CONVERSATION_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_CONVERSATION_SERVICE_URL:latest,DEV_DATABASE_NAME=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DATABASE_NAME:latest,DEV_DB_PASSWORD=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_PASSWORD:latest,DEV_DB_USER=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_DB_USER:latest,DEV_IDENTITY_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_IDENTITY_SERVICE_URL:latest,DEV_INVITATION_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_INVITATION_SERVICE_URL:latest,DEV_PAYMENT_SERVICE_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_PAYMENT_SERVICE_URL:latest,DEV_URL=projects/${{secrets.GCP_PROJECT_NUMBER}}/secrets/DEV_URL:latest" \ | ||
| --set-env-vars "SPRING_ACTIVE_PROFILE=${{env.environment}}" | ||
|
|
||
| #Step 12: Auth to attach the sub domain for the service | ||
| - name: Authenticate via WIF for DNS | ||
| id: auth-dns | ||
| uses: google-github-actions/auth@v0.4.0 | ||
| with: | ||
| workload_identity_provider: ${{needs.read-infra-outputs.outputs.pool_full_path}} | ||
| service_account: ${{needs.read-infra-outputs.outputs.github_dns_sa}} | ||
| project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
|
||
| # Step 13: Attach the subdomain to the Cloud Run service | ||
| - name: Attach subdomain to Cloud Run service | ||
| run: | | ||
| gcloud alpha run domain-mappings create \ | ||
| --service ${{ env.environment }}-${{ secrets.APP_NAME }}-api \ | ||
| --domain "${{ needs.read-infra-outputs.outputs.created_subdomain }}" \ | ||
| --region ${{ secrets.GCP_PREFERRED_REGION }} |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| myenv/ | ||
| .pytest_cache/ | ||
| __pycache__/ | ||
| .env | ||
| database_design.md | ||
| notes.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM python:3.11-slim-bullseye AS base | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential libpq-dev gcc netcat-openbsd \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
|
|
||
| COPY . . | ||
| RUN chmod +x /app/entrypoint.sh | ||
|
parthdande marked this conversation as resolved.
|
||
|
|
||
| ENTRYPOINT ["/app/entrypoint.sh"] | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you dont need this logic in dev-deploy.yml file. you can define variables here as "DEV_VARIABLE_NAME"