-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
150 lines (132 loc) · 4.77 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
trigger:
branches:
exclude:
- 'test'
include:
- '*'
pool:
vmImage: ubuntu-latest
jobs:
- job: mockE2E
timeoutInMinutes: 120
steps:
- script: npm install pnpm@8 -g && pnpm install && pnpm exec playwright install
displayName: 'Install dependencies'
- script: pnpm build
displayName: 'Build functions'
env:
FPCDN: $(MOCK_FPCDN)
INGRESS_API: $(MOCK_INGRESS_API)
NODE_OPTIONS: "--max_old_space_size=16384"
IS_RELEASE_BUILD: true
- script: pnpm build:example-website
displayName: 'Build website'
env:
VITE_API_KEY: $(API_KEY)
VITE_ENDPOINT: $(VITE_ENDPOINT)
VITE_SCRIPT_URL_PATTERN: $(VITE_SCRIPT_URL_PATTERN)
NODE_OPTIONS: "--max_old_space_size=16384"
- script: |
cd dist
zip -r package.zip *
mv package.zip ../
cd ..
displayName: 'Zip'
- task: AzureCLI@2
displayName: 'Deploy infrastructure'
env:
AZURE_STORAGE_ACCOUNT_NAME: $(AZURE_STORAGE_ACCOUNT_NAME)
AZURE_STORAGE_CONTAINER_NAME: $(AZURE_STORAGE_CONTAINER_NAME)
AZURE_STORAGE_RESOURCE_GROUP: $(AZURE_STORAGE_RESOURCE_GROUP)
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
FPJS_PRE_SHARED_SECRET: secret
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm e2e-deploy-infra'
- task: AzureCLI@2
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm test:mock-e2e'
displayName: 'Run e2e tests'
env:
CI: 'true'
API_URL: $(MOCK_FPCDN)
- task: AzureCLI@2
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm e2e-destroy-infra'
displayName: 'Destroy infrastructure'
condition: always()
env:
AZURE_STORAGE_ACCOUNT_NAME: $(AZURE_STORAGE_ACCOUNT_NAME)
AZURE_STORAGE_CONTAINER_NAME: $(AZURE_STORAGE_CONTAINER_NAME)
AZURE_STORAGE_RESOURCE_GROUP: $(AZURE_STORAGE_RESOURCE_GROUP)
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
FPJS_PRE_SHARED_SECRET: secret
- job: E2E
timeoutInMinutes: 120
steps:
- script: npm install pnpm@8 -g && pnpm install && npx playwright install
displayName: 'Install dependencies'
- script: pnpm build
displayName: 'Build functions'
env:
FPCDN: fpcdn.io
INGRESS_API: api.fpjs.io
NODE_OPTIONS: "--max_old_space_size=16384"
IS_RELEASE_BUILD: true
- script: pnpm build:example-website
displayName: 'Build website'
env:
VITE_API_KEY: $(API_KEY)
VITE_ENDPOINT: $(VITE_ENDPOINT)
VITE_SCRIPT_URL_PATTERN: $(VITE_SCRIPT_URL_PATTERN)
NODE_OPTIONS: "--max_old_space_size=16384"
- script: |
cd dist
zip -r package.zip *
mv package.zip ../
cd ..
displayName: 'Zip'
- task: AzureCLI@2
displayName: 'Deploy infrastructure'
env:
AZURE_STORAGE_ACCOUNT_NAME: $(AZURE_STORAGE_ACCOUNT_NAME)
AZURE_STORAGE_CONTAINER_NAME: $(AZURE_STORAGE_CONTAINER_NAME)
AZURE_STORAGE_RESOURCE_GROUP: $(AZURE_STORAGE_RESOURCE_GROUP)
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
FPJS_PRE_SHARED_SECRET: $(FPJS_PRE_SHARED_SECRET)
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm e2e-deploy-infra'
- task: AzureCLI@2
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm test:e2e'
displayName: 'Run e2e tests'
env:
CI: 'true'
- task: AzureCLI@2
inputs:
azureSubscription: 'azure-proxy-integration-e2e-tests'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'pnpm e2e-destroy-infra'
displayName: 'Destroy infrastructure'
condition: always()
env:
AZURE_STORAGE_ACCOUNT_NAME: $(AZURE_STORAGE_ACCOUNT_NAME)
AZURE_STORAGE_CONTAINER_NAME: $(AZURE_STORAGE_CONTAINER_NAME)
AZURE_STORAGE_RESOURCE_GROUP: $(AZURE_STORAGE_RESOURCE_GROUP)
AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
FPJS_PRE_SHARED_SECRET: $(FPJS_PRE_SHARED_SECRET)