Skip to content

Commit a7a084f

Browse files
authored
External demo all (#826)
* custom demo use cases validation * improvements on the reusable validation workflow * sprint demo environment with relevant use cases
1 parent d371cfe commit a7a084f

File tree

4 files changed

+213
-51
lines changed

4 files changed

+213
-51
lines changed

.github/workflows/deploy-demo-envs.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
use_cases_for_both:
1212
description: 'Enter the use cases to run for initial run (comma-separated). Example: ["demo_ar_workflows_gitlab","demo_ar_workflows_ansible"]'
1313
required: true
14-
default: '["demo_all"]'
14+
default: '[\"dynatrace-ace/ace-box-ext-hot-aiops-2025.git@demo\",\"demo_ar_workflows_gitlab\"]'
1515
type: string
1616
providers_for_both:
1717
description: 'Select the providers to run for initial run (comma-separated). Example: ["gcloud","aws"]'
@@ -67,6 +67,7 @@ jobs:
6767
destroy_resources: true
6868
use_case_validation_tests_enabled: false
6969
custom_domain: ${{ github.event.inputs.custom_domain_sprint }}
70+
ace_box_name_prefix: "ace-box-demo-sprint"
7071
dt_tenant: ${{ github.event.inputs.dt_tenant_sprint }}
7172
dt_url_gen3: ${{ github.event.inputs.dt_url_gen3_sprint }}
7273
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}
@@ -87,6 +88,7 @@ jobs:
8788
destroy_resources: false
8889
use_case_validation_tests_enabled: true
8990
custom_domain: ${{ github.event.inputs.custom_domain_sprint }}
91+
ace_box_name_prefix: "ace-box-demo-sprint"
9092
dt_tenant: ${{ github.event.inputs.dt_tenant_sprint }}
9193
dt_url_gen3: ${{ github.event.inputs.dt_url_gen3_sprint }}
9294
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}
@@ -106,6 +108,7 @@ jobs:
106108
destroy_resources: true
107109
use_case_validation_tests_enabled: false
108110
custom_domain: ${{ github.event.inputs.custom_domain_live }}
111+
ace_box_name_prefix: "ace-box-demo-live"
109112
dt_tenant: ${{ github.event.inputs.dt_tenant_live }}
110113
dt_url_gen3: ${{ github.event.inputs.dt_url_gen3_live }}
111114
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}
@@ -126,6 +129,7 @@ jobs:
126129
destroy_resources: false
127130
use_case_validation_tests_enabled: true
128131
custom_domain: ${{ github.event.inputs.custom_domain_live }}
132+
ace_box_name_prefix: "ace-box-demo-live"
129133
dt_tenant: ${{ github.event.inputs.dt_tenant_live }}
130134
dt_url_gen3: ${{ github.event.inputs.dt_url_gen3_live }}
131135
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
name: Deploy External Demo All
3+
4+
env:
5+
DEFAULT_EXTERNAL_USE_CASES: '[\"dynatrace-ace/basic-dt-demo.git\",\"dynatrace-ace/ace-box-ext-hot-aiops-2025.git@demo\"]'
6+
DEFAULT_PROVIDERS: '[\"gcloud\"]'
7+
DESTROY_RESOURCES: true
8+
USE_CASE_VALIDATION_TESTS_ENABLED: true
9+
DEFAULT_CUSTOM_DOMAIN: ""
10+
DEFAULT_ACE_BOX_NAME_PREFIX: "ace-box-gh-ext-demo"
11+
DT_TENANT: ${{ vars.DT_TENANT }}
12+
DT_URL_GEN3: ${{ vars.DT_URL_GEN3 }}
13+
DT_API_TOKEN: ${{ secrets.DT_API_TOKEN }}
14+
15+
on:
16+
# push:
17+
# branches:
18+
# - dev # Trigger after PR is merged to the dev branch
19+
workflow_dispatch: # Allows manual triggering of the workflow
20+
inputs:
21+
22+
providers:
23+
description: 'Select the providers to run (comma-separated). Example: ["gcloud","aws"]. For GCP, provide the GCP_CREDENTIALS_JSON in the Github repository secrets.'
24+
required: true
25+
default: '["gcloud"]'
26+
type: string
27+
28+
destroy_resources:
29+
description: 'Select to enable resource destruction'
30+
required: true
31+
default: true
32+
type: boolean
33+
34+
use_case_validation_tests_enabled:
35+
description: 'Select to enable use case validation tests'
36+
required: false
37+
default: false
38+
type: boolean
39+
40+
custom_domain:
41+
description: "Custom Domain Name. Example: demo.ace-innovation.info. Keep empty for temporary validations."
42+
required: false
43+
default: ""
44+
type: string
45+
ace_box_name_prefix:
46+
description: "Ace-Box Name Prefix to identify the resources created by this workflow. Example: demo-ace-box."
47+
required: false
48+
default: "ace-box-gh-pr-validate"
49+
type: string
50+
51+
# optional params for manual run
52+
dt_tenant:
53+
description: "Dynatrace Tenant. Keep empty to use the default tenant configured in the Github variables. For API Token, modify the DT_API_TOKEN secret in the Github repository settings."
54+
required: false
55+
default: ""
56+
type: string
57+
dt_url_gen3:
58+
description: "Dynatrace Environment URL Gen3. Keep empty to use the default tenant configured in the Github variables. For OAuth, modify the DT_OAUTH_CLIENT_ID and DT_OAUTH_CLIENT_SECRET secrets in the Github repository settings."
59+
required: false
60+
default: ""
61+
type: string
62+
63+
jobs:
64+
65+
set_env_vars:
66+
runs-on: spot
67+
outputs:
68+
use_cases: ${{ steps.set_outputs.outputs.use_cases }}
69+
providers: ${{ steps.set_outputs.outputs.providers }}
70+
destroy_resources: ${{ steps.set_outputs.outputs.destroy_resources }}
71+
use_case_validation_tests_enabled: ${{ steps.set_outputs.outputs.use_case_validation_tests_enabled }}
72+
custom_domain: ${{ steps.set_outputs.outputs.custom_domain }}
73+
ace_box_name_prefix: ${{ steps.set_outputs.outputs.ace_box_name_prefix }}
74+
dt_tenant: ${{ steps.set_outputs.outputs.dt_tenant }}
75+
dt_url_gen3: ${{ steps.set_outputs.outputs.dt_url_gen3 }}
76+
steps:
77+
- name: Set Environment Variables
78+
id: set_env
79+
run: |
80+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
81+
echo "use_cases=${{ env.DEFAULT_EXTERNAL_USE_CASES }}" >> "$GITHUB_ENV"
82+
echo "providers=$(echo '${{ github.event.inputs.providers }}' )" >> "$GITHUB_ENV"
83+
echo "destroy_resources=$(echo '${{ github.event.inputs.destroy_resources }}' )" >> "$GITHUB_ENV"
84+
echo "use_case_validation_tests_enabled=$(echo ${{ github.event.inputs.use_case_validation_tests_enabled }} )" >> "$GITHUB_ENV"
85+
echo "custom_domain=$(echo '${{ github.event.inputs.custom_domain }}' )" >> "$GITHUB_ENV"
86+
echo "ace_box_name_prefix=$(echo '${{ github.event.inputs.ace_box_name_prefix }}' )" >> "$GITHUB_ENV"
87+
echo "dt_tenant=$(echo '${{ github.event.inputs.dt_tenant }}' )" >> "$GITHUB_ENV"
88+
echo "dt_url_gen3=$(echo '${{ github.event.inputs.dt_url_gen3 }}' )" >> "$GITHUB_ENV"
89+
else
90+
echo "use_cases=${{ env.DEFAULT_EXTERNAL_USE_CASES }}" >> "$GITHUB_ENV"
91+
echo "providers=${{ env.DEFAULT_PROVIDERS }}" >> "$GITHUB_ENV"
92+
echo "destroy_resources=${{ env.DESTROY_RESOURCES }}" >> "$GITHUB_ENV"
93+
echo "use_case_validation_tests_enabled=${{ env.USE_CASE_VALIDATION_TESTS_ENABLED }}" >> "$GITHUB_ENV"
94+
echo "custom_domain=${{ env.DEFAULT_CUSTOM_DOMAIN }}" >> "$GITHUB_ENV"
95+
echo "ace_box_name_prefix=${{ env.DEFAULT_ACE_BOX_NAME_PREFIX }}" >> "$GITHUB_ENV"
96+
echo "dt_tenant=${{ env.DT_TENANT }}" >> "$GITHUB_ENV"
97+
echo "dt_url_gen3=${{ env.DT_URL_GEN3 }}" >> "$GITHUB_ENV"
98+
fi
99+
100+
- name: Convert use_case_validation_tests_enabled to Boolean
101+
run: |
102+
if [[ "${{ github.event.inputs.use_case_validation_tests_enabled }}" == "true" ]]; then
103+
echo "use_case_validation_tests_enabled=true" >> "$GITHUB_ENV"
104+
else
105+
echo "use_case_validation_tests_enabled=false" >> "$GITHUB_ENV"
106+
fi
107+
108+
- name: Set Outputs
109+
id: set_outputs
110+
run: |
111+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
112+
echo "use_cases=$(echo '${{ env.use_cases }}' )" >> "$GITHUB_OUTPUT"
113+
echo "providers=$(echo '${{ github.event.inputs.providers }}' )" >> "$GITHUB_OUTPUT"
114+
echo "destroy_resources=$(echo '${{ github.event.inputs.destroy_resources }}' )" >> "$GITHUB_OUTPUT"
115+
echo "use_case_validation_tests_enabled=$(echo '${{ github.event.inputs.use_case_validation_tests_enabled }}' )" >> "$GITHUB_OUTPUT"
116+
echo "custom_domain=$(echo '${{ github.event.inputs.custom_domain }}' )" >> "$GITHUB_OUTPUT"
117+
echo "ace_box_name_prefix=$(echo '${{ github.event.inputs.ace_box_name_prefix }}' )" >> "$GITHUB_OUTPUT"
118+
echo "dt_tenant=$(echo '${{ github.event.inputs.dt_tenant }}' )" >> "$GITHUB_OUTPUT"
119+
echo "dt_url_gen3=$(echo '${{ github.event.inputs.dt_url_gen3 }}' )" >> "$GITHUB_OUTPUT"
120+
else
121+
echo "use_cases=$(echo '${{ env.use_cases }}' )" >> "$GITHUB_OUTPUT"
122+
echo "providers=${{ env.DEFAULT_PROVIDERS }}" >> "$GITHUB_OUTPUT"
123+
echo "destroy_resources=${{ env.DESTROY_RESOURCES }}" >> "$GITHUB_OUTPUT"
124+
echo "use_case_validation_tests_enabled=${{ env.USE_CASE_VALIDATION_TESTS_ENABLED }}" >> "$GITHUB_OUTPUT"
125+
echo "custom_domain=${{ env.DEFAULT_CUSTOM_DOMAIN }}" >> "$GITHUB_OUTPUT"
126+
echo "ace_box_name_prefix=${{ env.DEFAULT_ACE_BOX_NAME_PREFIX }}" >> "$GITHUB_OUTPUT"
127+
echo "dt_tenant=${{ env.DT_TENANT }}" >> "$GITHUB_OUTPUT"
128+
echo "dt_url_gen3=${{ env.DT_URL_GEN3 }}" >> "$GITHUB_OUTPUT"
129+
fi
130+
shell: bash
131+
132+
133+
deploy_external_usecases:
134+
needs: set_env_vars
135+
uses: ./.github/workflows/validation.yaml
136+
with:
137+
use_cases: ${{ needs.set_env_vars.outputs.use_cases }}
138+
providers: ${{ needs.set_env_vars.outputs.providers }}
139+
destroy_resources: ${{ needs.set_env_vars.outputs.destroy_resources == 'true' }}
140+
use_case_validation_tests_enabled: ${{ needs.set_env_vars.outputs.use_case_validation_tests_enabled == 'true' }}
141+
custom_domain: ${{ needs.set_env_vars.outputs.custom_domain }}
142+
ace_box_name_prefix: ${{ needs.set_env_vars.outputs.ace_box_name_prefix }}
143+
dt_tenant: ${{ needs.set_env_vars.outputs.dt_tenant }}
144+
dt_url_gen3: ${{ needs.set_env_vars.outputs.dt_url_gen3 }}
145+
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}
146+
dt_oauth_account_urn: ${{ vars.DT_OAUTH_ACCOUNT_URN }}
147+
secrets: inherit

.github/workflows/pr_validation.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ on:
7373
default: ""
7474
type: string
7575

76+
ace_box_name_prefix:
77+
description: "Ace-Box Name Prefix to identify the resources created by this workflow. Example: demo-ace-box."
78+
required: false
79+
default: "ace-box-gh-pr-validate"
80+
type: string
81+
7682
# optional params for manual run
7783
dt_tenant:
7884
description: "Dynatrace Tenant. Keep empty to use the default tenant configured in the Github variables. For API Token, modify the DT_API_TOKEN secret in the Github repository settings."
@@ -89,8 +95,9 @@ env:
8995
DEFAULT_USE_CASES: '[\"demo_all\"]'
9096
DEFAULT_PROVIDERS: '[\"gcloud\"]'
9197
DESTROY_RESOURCES: true
92-
USE_CASE_VALIDATION_TESTS_ENABLED: false
98+
USE_CASE_VALIDATION_TESTS_ENABLED: true
9399
DEFAULT_CUSTOM_DOMAIN: ""
100+
DEFAULT_ACE_BOX_NAME_PREFIX: "ace-box-gh-pr-validate"
94101
DT_TENANT: ${{ vars.DT_TENANT }}
95102
DT_URL_GEN3: ${{ vars.DT_URL_GEN3 }}
96103
DT_API_TOKEN: ${{ secrets.DT_API_TOKEN }}
@@ -105,6 +112,7 @@ jobs:
105112
destroy_resources: ${{ steps.set_outputs.outputs.destroy_resources }}
106113
use_case_validation_tests_enabled: ${{ steps.set_outputs.outputs.use_case_validation_tests_enabled }}
107114
custom_domain: ${{ steps.set_outputs.outputs.custom_domain }}
115+
ace_box_name_prefix: ${{ steps.set_outputs.outputs.ace_box_name_prefix }}
108116
dt_tenant: ${{ steps.set_outputs.outputs.dt_tenant }}
109117
dt_url_gen3: ${{ steps.set_outputs.outputs.dt_url_gen3 }}
110118
steps:
@@ -117,6 +125,7 @@ jobs:
117125
echo "destroy_resources=$(echo '${{ github.event.inputs.destroy_resources }}' )" >> "$GITHUB_ENV"
118126
echo "use_case_validation_tests_enabled=$(echo ${{ github.event.inputs.use_case_validation_tests_enabled }} )" >> "$GITHUB_ENV"
119127
echo "custom_domain=$(echo '${{ github.event.inputs.custom_domain }}' )" >> "$GITHUB_ENV"
128+
echo "ace_box_name_prefix=$(echo '${{ github.event.inputs.ace_box_name_prefix }}' )" >> "$GITHUB_ENV"
120129
echo "dt_tenant=$(echo '${{ github.event.inputs.dt_tenant }}' )" >> "$GITHUB_ENV"
121130
echo "dt_url_gen3=$(echo '${{ github.event.inputs.dt_url_gen3 }}' )" >> "$GITHUB_ENV"
122131
else
@@ -125,6 +134,7 @@ jobs:
125134
echo "destroy_resources=${{ env.DESTROY_RESOURCES }}" >> "$GITHUB_ENV"
126135
echo "use_case_validation_tests_enabled=${{ env.USE_CASE_VALIDATION_TESTS_ENABLED }}" >> "$GITHUB_ENV"
127136
echo "custom_domain=${{ env.DEFAULT_CUSTOM_DOMAIN }}" >> "$GITHUB_ENV"
137+
echo "ace_box_name_prefix=${{ env.DEFAULT_ACE_BOX_NAME_PREFIX }}" >> "$GITHUB_ENV"
128138
echo "dt_tenant=${{ env.DT_TENANT }}" >> "$GITHUB_ENV"
129139
echo "dt_url_gen3=${{ env.DT_URL_GEN3 }}" >> "$GITHUB_ENV"
130140
fi
@@ -146,6 +156,7 @@ jobs:
146156
echo "destroy_resources=$(echo '${{ github.event.inputs.destroy_resources }}' )" >> "$GITHUB_OUTPUT"
147157
echo "use_case_validation_tests_enabled=$(echo '${{ github.event.inputs.use_case_validation_tests_enabled }}' )" >> "$GITHUB_OUTPUT"
148158
echo "custom_domain=$(echo '${{ github.event.inputs.custom_domain }}' )" >> "$GITHUB_OUTPUT"
159+
echo "ace_box_name_prefix=$(echo '${{ github.event.inputs.ace_box_name_prefix }}' )" >> "$GITHUB_OUTPUT"
149160
echo "dt_tenant=$(echo '${{ github.event.inputs.dt_tenant }}' )" >> "$GITHUB_OUTPUT"
150161
echo "dt_url_gen3=$(echo '${{ github.event.inputs.dt_url_gen3 }}' )" >> "$GITHUB_OUTPUT"
151162
else
@@ -154,6 +165,7 @@ jobs:
154165
echo "destroy_resources=${{ env.DESTROY_RESOURCES }}" >> "$GITHUB_OUTPUT"
155166
echo "use_case_validation_tests_enabled=${{ env.USE_CASE_VALIDATION_TESTS_ENABLED }}" >> "$GITHUB_OUTPUT"
156167
echo "custom_domain=${{ env.DEFAULT_CUSTOM_DOMAIN }}" >> "$GITHUB_OUTPUT"
168+
echo "ace_box_name_prefix=${{ env.DEFAULT_ACE_BOX_NAME_PREFIX }}" >> "$GITHUB_OUTPUT"
157169
echo "dt_tenant=${{ env.DT_TENANT }}" >> "$GITHUB_OUTPUT"
158170
echo "dt_url_gen3=${{ env.DT_URL_GEN3 }}" >> "$GITHUB_OUTPUT"
159171
fi
@@ -169,6 +181,7 @@ jobs:
169181
destroy_resources: ${{ needs.set_env_vars.outputs.destroy_resources == 'true' }}
170182
use_case_validation_tests_enabled: ${{ needs.set_env_vars.outputs.use_case_validation_tests_enabled == 'true' }}
171183
custom_domain: ${{ needs.set_env_vars.outputs.custom_domain }}
184+
ace_box_name_prefix: ${{ needs.set_env_vars.outputs.ace_box_name_prefix }}
172185
dt_tenant: ${{ needs.set_env_vars.outputs.dt_tenant }}
173186
dt_url_gen3: ${{ needs.set_env_vars.outputs.dt_url_gen3 }}
174187
dt_oauth_sso_endpoint: ${{ vars.DT_OAUTH_SSO_ENDPOINT }}

0 commit comments

Comments
 (0)