Skip to content

Commit

Permalink
feat(database): added mysql database
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi Markan committed Nov 7, 2023
1 parent b2a6632 commit ea1fc0d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
--name vnet-peer-apim-${{ env.TARGET }}-${{ env.PRODUCT }}-${{ vars.VERSION }} \
--query peeringState)"
- name: Database 📂
- name: Database 💾
uses: Azure/[email protected]
with:
inlineScript: |
Expand Down Expand Up @@ -498,10 +498,8 @@ jobs:
# 4. Database
database:
name: Database 💾
needs: [base, security]
environment: ${{ needs.setup.outputs.environment }}
outputs:
environment: ${{ env.ENVIRONMENT }}
needs: [base]
environment: ${{ needs.base.outputs.environment }}
runs-on: [self-hosted, EXIP, infrastructure]
steps:
- name: Pre-production 💫
Expand Down Expand Up @@ -557,7 +555,7 @@ jobs:
# 5. WebApp configuration
webapp:
name: Web App 🔧
needs: [base, security]
needs: [base, security, database]
environment: ${{ needs.base.outputs.environment }}
runs-on: [self-hosted, EXIP, infrastructure]
steps:
Expand Down Expand Up @@ -652,7 +650,7 @@ jobs:
WEBSITES_PORT='${{ vars.API_PORT }}' \
TLS_CERTIFICATE='${{ secrets.TLS_CERTIFICATE }}' \
TLS_KEY='${{ secrets.TLS_KEY }}' \
DATABASE_URL='${{ secrets.DATABASE_URL }}' \
DATABASE_URL='mysql://${{ secrets.MYSQL_USER }}:${{ secrets.MYSQL_PASSWORD }}@$(az mysql flexible-server list --query [].fullyQualifiedDomainName -o tsv):${{ vars.DB_PORT }}/${{ vars.PRODUCT }}' \
API_KEY='${{ secrets.API_KEY }}' \
APIM_MDM_URL='${{ secrets.APIM_MDM_URL }}' \
APIM_MDM_KEY='${{ secrets.APIM_MDM_KEY }}' \
Expand All @@ -673,8 +671,8 @@ jobs:
--source-id $(az webapp show --name app-${{ env.PRODUCT }}-api-${{ env.TARGET }}-${{ vars.VERSION }} --query id -o tsv) \
--target-id $(az mysql flexible-server list --query [].id -o tsv)/databases/${{ env.PRODUCT }} \
--connection webapp_api_mysqlflexible_${{ env.PRODUCT }}_${{ env.TARGET }}_${{ vars.VERSION }} \
--secret name= ${{ secrets.MYSQL_USER }} \
--secret secret= ${{ secrets.MYSQL_PASSWORD }} \
--secret name=${{ secrets.MYSQL_USER }} \
--secret secret=${{ secrets.MYSQL_PASSWORD }} \
--client-type nodejs
# 6. Logs and dignostic settings
Expand Down Expand Up @@ -780,7 +778,7 @@ jobs:
--workspace $(az monitor log-analytics workspace list --query [].id -o tsv) \
--metrics "[{category:allMetrics,enabled:true}]"
# 5. Health check alerts
# 7. Health check alerts
alert:
name: Alert 📢
needs: [base, security, database, webapp]
Expand Down

0 comments on commit ea1fc0d

Please sign in to comment.