-
Notifications
You must be signed in to change notification settings - Fork 641
144 lines (136 loc) · 5.84 KB
/
Copy pathdeploy-orchestrator.yml
File metadata and controls
144 lines (136 loc) · 5.84 KB
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
name: Deployment orchestrator
on:
workflow_call:
inputs:
runner_os:
description: 'Runner OS (ubuntu-latest or windows-latest)'
required: true
type: string
resource_group_name:
description: 'Resource Group Name (Optional)'
required: false
default: ''
type: string
waf_enabled:
description: 'Enable WAF'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
required: false
default: false
type: boolean
cleanup_resources:
description: 'Cleanup Deployed Resources'
required: false
default: false
type: boolean
run_e2e_tests:
description: 'Run End-to-End Tests'
required: false
default: 'GoldenPath-Testing'
type: string
existing_webapp_url:
description: 'Existing Container WebApp URL (Skips Deployment)'
required: false
default: ''
type: string
existing_admin_app_url:
description: 'Existing Admin WebApp URL (Skips Deployment)'
required: false
default: ''
type: string
trigger_type:
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
required: true
type: string
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
description: 'Log Analytics Workspace ID (Optional)'
required: false
default: ''
type: string
AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION:
description: 'Enable Azure Search Integrated Vectorization'
required: false
default: 'false'
type: string
AZURE_SEARCH_USE_SEMANTIC_SEARCH:
description: 'Enable Azure Search Semantic Search'
required: false
default: 'false'
type: string
USE_ADVANCED_IMAGE_PROCESSING:
description: 'Use Advanced Image Processing'
required: false
default: 'false'
type: string
DATABASE_TYPE:
description: 'Type of database to use'
required: false
default: 'PostgreSQL'
type: string
env:
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
jobs:
deploy:
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
uses: ./.github/workflows/job-deploy.yml
with:
trigger_type: ${{ inputs.trigger_type }}
runner_os: ${{ inputs.runner_os }}
resource_group_name: ${{ inputs.resource_group_name }}
waf_enabled: ${{ inputs.waf_enabled }}
EXP: ${{ inputs.EXP }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
cleanup_resources: ${{ inputs.cleanup_resources }}
AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION: ${{ inputs.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION }}
AZURE_SEARCH_USE_SEMANTIC_SEARCH: ${{ inputs.AZURE_SEARCH_USE_SEMANTIC_SEARCH }}
USE_ADVANCED_IMAGE_PROCESSING: ${{ inputs.USE_ADVANCED_IMAGE_PROCESSING }}
DATABASE_TYPE: ${{ inputs.DATABASE_TYPE }}
secrets: inherit
e2e-test:
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '' && needs.deploy.outputs.ADMIN_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null && inputs.existing_admin_app_url != '' && inputs.existing_admin_app_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
needs: [deploy]
uses: ./.github/workflows/test-automation-v2.yml
with:
TEST_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
ADMIN_APPURL: ${{ needs.deploy.outputs.ADMIN_APPURL || inputs.existing_admin_app_url }}
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
secrets: inherit
cleanup-deployment:
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
needs: [deploy, e2e-test]
uses: ./.github/workflows/job-cleanup-deployment.yml
with:
runner_os: ${{ inputs.runner_os }}
trigger_type: ${{ inputs.trigger_type }}
cleanup_resources: ${{ inputs.cleanup_resources }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
secrets: inherit
send-notification:
if: "!cancelled()"
needs: [deploy, e2e-test, cleanup-deployment]
uses: ./.github/workflows/job-send-notification.yml
with:
trigger_type: ${{ inputs.trigger_type }}
waf_enabled: ${{ inputs.waf_enabled }}
EXP: ${{ inputs.EXP }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
deploy_result: ${{ needs.deploy.result }}
e2e_test_result: ${{ needs.e2e-test.result }}
cleanup_result: ${{ needs.cleanup-deployment.result }}
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
secrets: inherit