Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dingmeng-xue committed Mar 7, 2024
1 parent b88ff8e commit fc7c0d8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,27 @@ on:
paths:
- 'apps/acme-catalog/**'
env:
SPRING_APPS_SERVICE: ${{ secrets.TF_PROJECT_NAME }}-asa
RESOURCE_GROUP: ${{ secrets.TF_PROJECT_NAME }}-grp
KEY_VAULT: ${{ secrets.TF_PROJECT_NAME }}-keyvault
SPRING_APPS_SERVICE: ${{ secrets.SPRING_APPS_SERVICE }}
RESOURCE_GROUP: ${{ secrets.RESOURCE_GROUP }}
CATALOG_SERVICE_APP: catalog-service

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/acme-catalog
steps:
- name: 'Az CLI login'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION }}
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -33,23 +42,20 @@ jobs:
with:
arguments: build
build-root-directory: apps/acme-catalog
- name: Set up Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set up Azure Spring Extension
run: az extension add --name spring
- name: Deploy Catalog
run: |
keyvault_uri=$(az keyvault show \
keyvault_uri=$(az keyvault show \
--resource-group ${RESOURCE_GROUP} \
--name ${KEY_VAULT} | jq -r '.properties.vaultUri')
--name ${KEY_VAULT} \
--query properties.vaultUri -o tsv)
az spring app deploy \
--name ${CATALOG_SERVICE_APP} \
--resource-group "$RESOURCE_GROUP" \
--service "$SPRING_APPS_SERVICE" \
--env "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_ENDPOINT=${keyvault_uri}" "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_NAME='acme-fitness-store-vault'" "SPRING_PROFILES_ACTIVE=default,key-vault" \
--env "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_ENDPOINT=${keyvault_uri}" "SPRING_CLOUD_AZURE_KEYVAULT_SECRET_PROPERTY_SOURCES_0_NAME=${KEY_VAULT}" "SPRING_PROFILES_ACTIVE=default,key-vault" \
--config-file-pattern catalog/default,catalog/key-vault \
--build-env BP_JVM_VERSION=17 \
--source-path ./

0 comments on commit fc7c0d8

Please sign in to comment.