Skip to content

Commit d5b0130

Browse files
committed
feat: add azure-build-from-source.yaml for e2e test workflows
1 parent d7113aa commit d5b0130

2 files changed

Lines changed: 211 additions & 2 deletions

File tree

.github/workflows/test-e2e-pr.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ jobs:
102102
- name: Turn on Kustomize support
103103
run: azd config set alpha.aks.kustomize on
104104

105+
- name: Swap azd config files to build from source
106+
run: |
107+
mv azure.yaml azure.yaml.bak
108+
mv azure-build-from-source.yaml azure.yaml
109+
105110
- name: Provision resources and deploy app
106111
run: |
107112
azd env new ${{ vars.AZURE_ENV_NAME }}
108-
azd env set AKS_NODE_POOL_VM_SIZE Standard_D2_v4
109113
azd env set DEPLOY_AZURE_CONTAINER_REGISTRY true
110114
azd env set DEPLOY_AZURE_OPENAI true
111115
azd env set AZURE_OPENAI_LOCATION ${{ vars.AZURE_LOCATION }}
112-
azd env set DEPLOY_AZURE_OPENAI_DALL_E_MODEL false
113116
azd env set DEPLOY_AZURE_SERVICE_BUS true
114117
azd env set DEPLOY_AZURE_COSMOSDB true
115118
azd env set AZURE_COSMOSDB_ACCOUNT_KIND MongoDB

azure-build-from-source.yaml

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
2+
3+
name: aks-store-demo
4+
metadata:
5+
template: aks-store-demo@1.1.0
6+
infra:
7+
provider: terraform
8+
path: infra/terraform
9+
# infra:
10+
# provider: bicep
11+
# path: infra/bicep
12+
hooks:
13+
preprovision:
14+
posix:
15+
shell: sh
16+
continueOnError: false
17+
interactive: false
18+
run: azd-hooks/preprovision.sh
19+
windows:
20+
shell: pwsh
21+
continueOnError: false
22+
interactive: false
23+
run: azd-hooks/preprovision.ps1
24+
predeploy:
25+
posix:
26+
shell: sh
27+
continueOnError: false
28+
interactive: false
29+
run: azd-hooks/predeploy.sh
30+
windows:
31+
shell: pwsh
32+
continueOnError: false
33+
interactive: false
34+
run: azd-hooks/predeploy.ps1
35+
services:
36+
ai-service:
37+
project: src/ai-service
38+
language: docker
39+
docker:
40+
context: .
41+
path: Dockerfile
42+
host: aks
43+
k8s:
44+
namespace: pets
45+
kustomize:
46+
dir: ../../kustomize/overlays/azd/ai-service
47+
edits:
48+
- set image ai-service=${SERVICE_AI_SERVICE_IMAGE_NAME}
49+
- add annotation azure.workload.identity/client-id:${AZURE_IDENTITY_CLIENT_ID}
50+
env:
51+
AZURE_OPENAI_ENDPOINT: ${AZURE_OPENAI_ENDPOINT}
52+
AZURE_OPENAI_DEPLOYMENT_NAME: ${AZURE_OPENAI_MODEL_NAME}
53+
USE_AZURE_OPENAI: "True"
54+
USE_AZURE_AD: "True"
55+
hooks:
56+
postdeploy:
57+
posix:
58+
shell: sh
59+
continueOnError: false
60+
interactive: false
61+
run: git restore ../../kustomize/overlays/azd/ai-service/kustomization.yaml
62+
windows:
63+
shell: pwsh
64+
continueOnError: false
65+
interactive: false
66+
run: git restore ../../kustomize/overlays/azd/ai-service/kustomization.yaml
67+
product-service:
68+
project: src/product-service
69+
language: docker
70+
docker:
71+
context: .
72+
path: Dockerfile
73+
host: aks
74+
k8s:
75+
namespace: pets
76+
kustomize:
77+
dir: ../../kustomize/overlays/azd/product-service
78+
edits:
79+
- set image product-service=${SERVICE_PRODUCT_SERVICE_IMAGE_NAME}
80+
hooks:
81+
postdeploy:
82+
posix:
83+
shell: sh
84+
continueOnError: false
85+
interactive: false
86+
run: git restore ../../kustomize/overlays/azd/product-service/kustomization.yaml
87+
windows:
88+
shell: pwsh
89+
continueOnError: false
90+
interactive: false
91+
run: git restore ../../kustomize/overlays/azd/product-service/kustomization.yaml
92+
order-service:
93+
project: src/order-service
94+
language: docker
95+
docker:
96+
context: .
97+
path: Dockerfile
98+
host: aks
99+
k8s:
100+
namespace: pets
101+
kustomize:
102+
dir: ../../kustomize/overlays/azd/order-service
103+
edits:
104+
- set image order-service=${SERVICE_ORDER_SERVICE_IMAGE_NAME}
105+
- add annotation azure.workload.identity/client-id:${AZURE_IDENTITY_CLIENT_ID}
106+
env:
107+
ORDER_QUEUE_HOSTNAME: ${AZURE_SERVICE_BUS_HOST}
108+
ORDER_QUEUE_NAME: "orders"
109+
USE_WORKLOAD_IDENTITY_AUTH: "true"
110+
FASTIFY_ADDRESS: "0.0.0.0"
111+
hooks:
112+
postdeploy:
113+
posix:
114+
shell: sh
115+
continueOnError: false
116+
interactive: false
117+
run: git restore ../../kustomize/overlays/azd/order-service/kustomization.yaml
118+
windows:
119+
shell: pwsh
120+
continueOnError: false
121+
interactive: false
122+
run: git restore ../../kustomize/overlays/azd/order-service/kustomization.yaml
123+
makeline-service:
124+
project: src/makeline-service
125+
language: docker
126+
docker:
127+
context: .
128+
path: Dockerfile
129+
host: aks
130+
k8s:
131+
namespace: pets
132+
kustomize:
133+
dir: ../../kustomize/overlays/azd/makeline-service
134+
edits:
135+
- set image makeline-service=${SERVICE_MAKELINE_SERVICE_IMAGE_NAME}
136+
- add annotation azure.workload.identity/client-id:${AZURE_IDENTITY_CLIENT_ID}
137+
env:
138+
ORDER_QUEUE_HOSTNAME: ${AZURE_SERVICE_BUS_HOST}
139+
ORDER_QUEUE_NAME: "orders"
140+
USE_WORKLOAD_IDENTITY_AUTH: "true"
141+
ORDER_DB_URI: ${AZURE_COSMOS_DATABASE_URI}
142+
ORDER_DB_LIST_CONNECTION_STRING_URL: ${AZURE_COSMOS_DATABASE_LIST_CONNECTIONSTRINGS_URL}
143+
ORDER_DB_COLLECTION_NAME: "orders"
144+
ORDER_DB_NAME: "orderdb"
145+
hooks:
146+
postdeploy:
147+
posix:
148+
shell: sh
149+
continueOnError: false
150+
interactive: false
151+
run: git restore ../../kustomize/overlays/azd/makeline-service/kustomization.yaml
152+
windows:
153+
shell: pwsh
154+
continueOnError: false
155+
interactive: false
156+
run: git restore ../../kustomize/overlays/azd/makeline-service/kustomization.yaml
157+
store-front:
158+
project: src/store-front
159+
language: docker
160+
docker:
161+
context: .
162+
path: Dockerfile
163+
host: aks
164+
k8s:
165+
namespace: pets
166+
kustomize:
167+
dir: ../../kustomize/overlays/azd/store-front
168+
edits:
169+
- set image store-front=${SERVICE_STORE_FRONT_IMAGE_NAME}
170+
hooks:
171+
postdeploy:
172+
posix:
173+
shell: sh
174+
continueOnError: false
175+
interactive: false
176+
run: git restore ../../kustomize/overlays/azd/store-front/kustomization.yaml
177+
windows:
178+
shell: pwsh
179+
continueOnError: false
180+
interactive: false
181+
run: git restore ../../kustomize/overlays/azd/store-front/kustomization.yaml
182+
store-admin:
183+
project: src/store-admin
184+
language: docker
185+
docker:
186+
context: .
187+
path: Dockerfile
188+
host: aks
189+
k8s:
190+
namespace: pets
191+
kustomize:
192+
dir: ../../kustomize/overlays/azd/store-admin
193+
edits:
194+
- set image store-admin=${SERVICE_STORE_ADMIN_IMAGE_NAME}
195+
hooks:
196+
postdeploy:
197+
posix:
198+
shell: sh
199+
continueOnError: false
200+
interactive: false
201+
run: git restore ../../kustomize/overlays/azd/store-admin/kustomization.yaml
202+
windows:
203+
shell: pwsh
204+
continueOnError: false
205+
interactive: false
206+
run: git restore ../../kustomize/overlays/azd/store-admin/kustomization.yaml

0 commit comments

Comments
 (0)