-
Notifications
You must be signed in to change notification settings - Fork 23
427 lines (360 loc) · 23.5 KB
/
argo.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
name: Reset Argo ENV and Testdata import
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Which Environment
required: true
options:
- Dev/Test
- E2E-A/E2E-B
- int-a/int-b
- association int-a/int-b
testdata_version:
description: Which Testdata Version CX_Testdata_MessagingTest_v<X.X.X>.json e.g., 0.0.14"
required: true
argo_token:
description: Argo Token
required: true
hard_refresh:
type: choice
description: Do you want a Hard Refresh? (+5min execution time)
required: true
options:
- Yes
- No
testdata_upload:
type: choice
description: Do you want a testdata upload?
required: true
options:
- Yes
- No
env:
ARGO_TEST_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-test"
ARGO_TEST_EDC_PROVIDER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-test-edc-provider"
ARGO_TEST_TRACE_X_INSTANCE: "https://argo.dev.demo.catena-x.net/api/v1/applications/traceability-foss-test"
ARGO_TEST_SUBMODELSERVER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-test-submodelserver"
ARGO_TEST_RegistryReload: "https://traceability-test.dev.demo.catena-x.net/api/registry/reload"
ARGO_DEV_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-dev"
ARGO_DEV_EDC_PROVIDER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-edc-provider"
ARGO_DEV_TRACE_X_INSTANCE: "https://argo.dev.demo.catena-x.net/api/v1/applications/traceability-foss-dev"
ARGO_DEV_SUBMODELSERVER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dev-submodelserver"
ARGO_DEV_RegistryReload: "https://traceability.dev.demo.catena-x.net/api/registry/reload"
ARGO_E2E_A_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-e2e-a"
ARGO_E2E_A_EDC_PROVIDER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-edc-provider-e2e-a"
ARGO_E2E_A_TRACE_X_INSTANCE: "https://argo.dev.demo.catena-x.net/api/v1/applications/traceability-foss-e2e-a"
ARGO_E2E_A_SUBMODELSERVER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-e2e-a-submodelserver"
ARGO_E2E_A_RegistryReload: "https://traceability-e2e-a.dev.demo.catena-x.net/api/registry/reload"
ARGO_E2E_B_REGISTRY: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-dt-registry-e2e-b"
ARGO_E2E_B_EDC_PROVIDER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-edc-provider-e2e-b"
ARGO_E2E_B_TRACE_X_INSTANCE: "https://argo.dev.demo.catena-x.net/api/v1/applications/traceability-foss-e2e-b"
ARGO_E2E_B_SUBMODELSERVER: "https://argo.dev.demo.catena-x.net/api/v1/applications/tracex-e2e-b-submodelserver"
ARGO_E2E_B_RegistryReload: "https://traceability-e2e-b.dev.demo.catena-x.net/api/registry/reload"
ARGO_INT_A_REGISTRY: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-registry-int-a"
ARGO_INT_A_EDC_PROVIDER: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-edc-provider-int-a"
ARGO_INT_A_TRACE_X_INSTANCE: "https://argo.int.demo.catena-x.net/api/v1/applications/traceability-foss-int-a"
ARGO_INT_A_SUBMODELSERVER: "https://argo.int.demo.catena-x.net/api/v1/applications/tracex-int-a-submodelserver"
ARGO_INT_A_RegistryReload: "https://traceability-int-a.int.demo.catena-x.net/api/registry/reload"
ARGO_INT_B_REGISTRY: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-registry-int-b"
ARGO_INT_B_EDC_PROVIDER: "https://argo.int.demo.catena-x.net/api/v1/applications/tx-edc-provider-int-b"
ARGO_INT_B_TRACE_X_INSTANCE: "https://argo.int.demo.catena-x.net/api/v1/applications/traceability-foss-int-b"
ARGO_INT_B_SUBMODELSERVER: "https://argo.int.demo.catena-x.net/api/v1/applications/tracex-int-b-submodelserver"
ARGO_INT_B_RegistryReload: "https://traceability-int-b.int.demo.catena-x.net/api/registry/reload"
ARGO_ASSOCIATION_INT_A_REGISTRY: "https://argocd.int.catena-x.net/api/v1/applications/tracex-registry-int-a"
ARGO_ASSOCIATION_INT_A_EDC_PROVIDER: "https://argocd.int.catena-x.net/api/v1/applications/tx-edc-provider-int-a"
ARGO_ASSOCIATION_INT_A_TRACE_X_INSTANCE: "https://argocd.int.catena-x.net/api/v1/applications/traceability-foss-int-a"
ARGO_ASSOCIATION_INT_A_SUBMODELSERVER: "https://argocd.int.catena-x.net/api/v1/applications/trace-x-int-a-submodelserver-submodelservers"
ARGO_ASSOCIATION_INT_B_REGISTRY: "https://argocd.int.catena-x.net/api/v1/applications/tracex-registry-int-b"
ARGO_ASSOCIATION_INT_B_EDC_PROVIDER: "https://argocd.int.catena-x.net/api/v1/applications/tx-edc-provider-int-b"
ARGO_ASSOCIATION_INT_B_TRACE_X_INSTANCE: "https://argocd.int.catena-x.net/api/v1/applications/traceability-foss-int-b"
ARGO_ASSOCIATION_INT_B_SUBMODELSERVER: "https://argocd.int.catena-x.net/api/v1/applications/trace-x-int-b-submodelserver-submodelservers"
jobs:
test_input:
runs-on: ubuntu-latest
steps:
- name: Checkout-Repository
uses: actions/checkout@v4
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Check Testdata Version Format
run: |
if [[ ! "${{ github.event.inputs.testdata_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
echo "Invalid Testdata Version format. Please use X.X.X or X.X.X-suffix, e.g., 1.1.12"
exit 1
fi
- name: Check Argo Token
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources="${DEV_TEST_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources="${E2E_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources="${INT_RESOURCES[2]}"
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources="${ASSOCIATION_INT_RESOURCES[2]}"
fi
data=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resources")
status_app=$(echo "$data" | jq -r '.status.sync.status')
if [ $status_app != null ]; then
echo "Argo Token is valid."
else
echo "Argo Token is invalid."
exit 1
fi
print_environment:
needs: test_input
runs-on: ubuntu-latest
steps:
- name: ${{ github.event.inputs.environment }}
run: |
echo "### inputs" >> $GITHUB_STEP_SUMMARY
echo "- environment: ${{ github.event.inputs.environment }}" >> $GITHUB_STEP_SUMMARY
echo "- test data version: ${{ github.event.inputs.testdata_version }}" >> $GITHUB_STEP_SUMMARY
echo "- do hard refresh: ${{ github.event.inputs.hard_refresh }}" >> $GITHUB_STEP_SUMMARY
echo "- upload test data: ${{ github.event.inputs.testdata_upload }}" >> $GITHUB_STEP_SUMMARY
hard_refresh_environment:
needs: print_environment
runs-on: ubuntu-latest
steps:
- name: Checkout-Repository
uses: actions/checkout@v4
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Hard refresh environment ${{ github.event.inputs.environment }}
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.hard_refresh }}" == "true" ]; then
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource?refresh=hard&appNamespace=argocd"
done
sleep 40
elif [ "${{ github.event.inputs.hard_refresh }}" == "false" ]; then
echo "Hard refresh skipped"
fi
delete_environment:
needs: hard_refresh_environment
runs-on: ubuntu-latest
steps:
- name: Checkout-Repository
uses: actions/checkout@v4
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Delete Argo Environment
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DELETE_DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${DELETE_E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${DELETE_INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${DELETE_ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource"
sleep 2
done
sleep 10
change_target_revision:
needs: delete_environment
runs-on: ubuntu-latest
steps:
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Change TargetRevison
run: |
new_target_revision=${{ github.ref_name }}
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
json_data1=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$ARGO_TEST_TRACE_X_INSTANCE")
old_TargetRevision1=$(echo "$json_data1" | jq -r '.spec.source.targetRevision')
json_data2=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$ARGO_DEV_TRACE_X_INSTANCE")
old_TargetRevision2=$(echo "$json_data2" | jq -r '.spec.source.targetRevision')
if [ "$old_TargetRevision1" != "$new_target_revision" ]; then
updated_json1=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json1" "$ARGO_TEST_TRACE_X_INSTANCE"
echo "Target Revision for Test overwritten"
fi
if [ "$old_TargetRevision2" != "$new_target_revision" ]; then
updated_json2=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json2" "$ARGO_DEV_TRACE_X_INSTANCE"
echo "Target Revision for Dev overwritten"
fi
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
json_data1=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$ARGO_E2E_A_TRACE_X_INSTANCE")
old_TargetRevision1=$(echo "$json_data1" | jq -r '.spec.source.targetRevision')
json_data2=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$ARGO_E2E_B_TRACE_X_INSTANCE")
old_TargetRevision2=$(echo "$json_data2" | jq -r '.spec.source.targetRevision')
if [ "$old_TargetRevision1" != "$new_target_revision" ]; then
updated_json1=$(echo "$json_data1" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json1" "$ARGO_E2E_A_TRACE_X_INSTANCE"
echo "Target Revision for e2e-a overwritten"
fi
if [ "$old_TargetRevision2" != "$new_target_revision" ]; then
updated_json2=$(echo "$json_data2" | jq ".spec.source.targetRevision = \"$new_target_revision\"")
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -d "$updated_json2" "$ARGO_E2E_B_TRACE_X_INSTANCE"
echo "Target Revision for e2e-b overwritten"
fi
fi
sync_environment:
needs: change_target_revision
runs-on: ubuntu-latest
steps:
- name: Checkout-Repository
uses: actions/checkout@v4
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: Sync Argo Environment
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${SYNC_DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${SYNC_E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${SYNC_INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${SYNC_ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource"
done
sleep 20
test_state:
needs: sync_environment
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: mask token
run: |
ARGO_TOKEN=$(jq -r '.inputs.argo_token' $GITHUB_EVENT_PATH)
echo ::add-mask::$ARGO_TOKEN
echo ARGO_TOKEN=$ARGO_TOKEN >> $GITHUB_ENV
- name: test apps state
run: |
source ./.github/argo/argo_config.sh
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
resources=("${DEV_TEST_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
resources=("${E2E_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
resources=("${INT_RESOURCES[@]}")
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
resources=("${ASSOCIATION_INT_RESOURCES[@]}")
fi
for resource in "${resources[@]}"; do
while true; do
json_data=$(curl -X GET -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" "$resource")
status=$(echo "$json_data" | jq -r '.status.sync.status')
health=$(echo "$json_data" | jq -r '.status.health.status')
operationState=$(echo "$json_data" | jq -r '.status.operationState.phase')
if [ "$status" == "Synced" ] && [ "$health" == "Healthy" ] && [ "$operationState" == "Succeeded" ]; then
echo "ready"
break
elif [ "$operationState" == "Failed" ] || ([ "$status" == "OutOfSync" ] && [ "$operationState" == "Failed" ]) || ([ "$status" == "OutOfSync" ] && [ "$operationState" == "Succeeded" ]); then
echo "Another sync"
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/sync"
sleep 10
elif [ "$status" == "OutOfSync" ] && [ "$operationState" == "Running" ]; then
echo "First terminate sync then start another sync"
curl -X DELETE -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/operation?appNamespace=argocd"
sleep 10
curl -X POST -H "Authorization: Bearer ${{ env.ARGO_TOKEN }}" -H "Content-Type: application/json" "$resource/sync"
sleep 10
else
echo "Wait"
sleep 10
fi
done
done
sleep 120
upload_testdata:
needs: test_state
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Upload testdata
run: |
python -m pip install requests
curl -o transform-and-upload.py https://raw.githubusercontent.com/eclipse-tractusx/item-relationship-service/main/local/testing/testdata/transform-and-upload.py
if [ "${{ github.event.inputs.testdata_upload }}" == "true" ]; then
if [ "${{ github.event.inputs.environment }}" == "Dev/Test" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-test-submodel-server.dev.demo.catena-x.net -edc https://trace-x-test-edc.dev.demo.catena-x.net -a https://trace-x-registry-test.dev.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-test-edc-dataplane.dev.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_DEV }} --aas3 --edcBPN BPNL00000003CNKC --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-dev-submodel-server.dev.demo.catena-x.net -edc https://trace-x-edc.dev.demo.catena-x.net -a https://trace-x-registry-dev.dev.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-dataplane.dev.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_DEV }} --aas3 --edcBPN BPNL00000003CML1 --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "E2E-A/E2E-B" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-e2e-a-submodel-server.dev.demo.catena-x.net -edc https://trace-x-edc-e2e-a.dev.demo.catena-x.net -a https://trace-x-registry-e2e-a.dev.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-e2e-a-dataplane.dev.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_DEV }} --aas3 --edcBPN BPNL00000003CML1 --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-e2e-b-submodel-server.dev.demo.catena-x.net -edc https://trace-x-edc-e2e-b.dev.demo.catena-x.net -a https://trace-x-registry-e2e-b.dev.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-e2e-b-dataplane.dev.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_DEV }} --aas3 --edcBPN BPNL00000003CNKC --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "int-a/int-b" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-a-submodel-server.int.demo.catena-x.net -edc https://trace-x-edc-int-a.int.demo.catena-x.net -a https://trace-x-registry-int-a.int.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-a-dataplane.int.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_INT_A }} --aas3 --edcBPN BPNL00000003CML1 --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC BPNL00000003AZQP BPNL00000003CSGV
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-b-submodel-server.int.demo.catena-x.net -edc https://trace-x-edc-int-b.int.demo.catena-x.net -a https://trace-x-registry-int-b.int.demo.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-b-dataplane.int.demo.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_INT_B }} --aas3 --edcBPN BPNL00000003CNKC --allowedBPNs BPNL00000003CML1 BPNL00000003CNKC BPNL00000003AZQP BPNL00000003CSGV
sleep 10
elif [ "${{ github.event.inputs.environment }}" == "association int-a/int-b" ]; then
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-a-submodel-server.int.catena-x.net -edc https://trace-x-edc-int-a.int.catena-x.net -a https://trace-x-registry-int-a.int.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-a-dataplane.int.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_ASSOCIATION_INT }} --aas3 --edcBPN BPNL000000000UKM --allowedBPNs BPNL000000000UKM BPNL000000000DWF BPNL000000000EVQ BPNL00000003CSGV
sleep 10
python transform-and-upload.py -f ./tx-backend/testdata/CX_Testdata_MessagingTest_v${{ github.event.inputs.testdata_version }}.json -s https://tracex-int-b-submodel-server.int.catena-x.net -edc https://trace-x-edc-int-b.int.catena-x.net -a https://trace-x-registry-int-b.int.catena-x.net/semantics/registry/api/v3 -d https://trace-x-edc-int-b-dataplane.int.catena-x.net -p traceability-core -k ${{ secrets.TRACE_X_API_KEY_ASSOCIATION_INT }} --aas3 --edcBPN BPNL000000000DWF --allowedBPNs BPNL000000000DWF BPNL000000000UKM BPNL000000000EVQ BPNL00000003CSGV
sleep 10
fi
elif [ "${{ github.event.inputs.testdata_upload }}" == "false" ]; then
echo "Testdata upload skipped"
fi