-
Notifications
You must be signed in to change notification settings - Fork 1
516 lines (463 loc) · 22.2 KB
/
Processors_CI_CD_Workflow.yaml
File metadata and controls
516 lines (463 loc) · 22.2 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
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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
name: Processors_CI_CD_Workflow # Define the name of the workflow
# Define when the workflow should trigger
on:
workflow_dispatch:
inputs:
knowhow_common_branch:
description: 'Type the Branch to use from knowhow-common repo'
required: true
default: 'develop'
type: string
test:
description: 'Run tests'
required: true
default: 'true'
type: choice
options:
- "false"
- "true"
deploy:
description: 'Do you want to deploy after build?'
required: true
default: 'true'
type: choice
options:
- "false"
- "true"
env:
description: 'Environment to deploy'
required: true
default: 'dev'
type: choice
options:
- dev
- dev1
- qa
- stage
processor:
description: 'Processor to build and deploy'
required: true
default: 'all'
type: choice
options:
- all
- jira
- azureboard
- azurepipelines
- devops
- rally-processor
- scm-processor
- ai-data-processor
# Define environment variables
env:
JIRA_NAME: knowhow-processors-jira
DEVOPS_NAME: knowhow-processors-devops-processor
AZUREBOARD_NAME: knowhow-processors-azure-boards
AZUREPIPELINE_NAME: knowhow-processors-azure-pipeline-repo-processor
RALLY_NAME: knowhow-processors-rally
SCM_NAME: knowhow-processors-knowhow-scm-processor
AI_DATA_PROCESSOR_NAME: knowhow-processors-ai-data-processor
ACR_NAME: ${{ secrets.SPEEDTOOLS_ACR_NAME }} # without .azurecr.io
ACR_LOGIN_SERVER: ${{ secrets.SPEEDTOOLS_ACR_LOGIN_SERVER }} # e.g. myacr.azurecr.io
BITBUCKET_HELM_REPO: ${{ secrets.SPEEDTOOLS_BITBUCKET_HELM_REPO }} # HTTPS clone URL (without creds)
GITHUB_HEAD_NAME: $GITHUB_HEAD_REF # Store the head branch name
sonartoken: ${{ secrets.SONARQUBE_TOKEN }} # Secret for SonarQube authentication
sonarurl: ${{ secrets.SONARURL }} # SonarQube URL stored in secrets
jobs:
# ✅ Building & Testing Processors
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Set IMAGE_TAG and values file
id: set_env
run: |
ENV="${{ github.event.inputs.env }}"
if [[ "$ENV" == "qa" ]]; then
echo "IMAGE_TAG=qa-${GITHUB_SHA::8}" >> $GITHUB_ENV
echo "VALUES_FILE=values-qa.yaml" >> $GITHUB_ENV
elif [[ "$ENV" == "stage" ]]; then
echo "IMAGE_TAG=master-${GITHUB_SHA::8}" >> $GITHUB_ENV
echo "VALUES_FILE=values-stage.yaml" >> $GITHUB_ENV
elif [[ "$ENV" == "dev1" ]]; then
echo "IMAGE_TAG=dev1-${GITHUB_SHA::8}" >> $GITHUB_ENV
echo "VALUES_FILE=values-dev1.yaml" >> $GITHUB_ENV
else
echo "IMAGE_TAG=dev-${GITHUB_SHA::8}" >> $GITHUB_ENV
echo "VALUES_FILE=values-dev.yaml" >> $GITHUB_ENV
fi
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure Maven to use GitHub Packages
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml <<EOF
<settings>
<servers>
<server>
<id>github</id>
<username>${{ github.actor }}</username>
<password>${{ secrets.MAVEN_TOKEN }}</password>
</server>
</servers>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/PublicisSapient/knowhow-retro-notifications-lib</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
</settings>
EOF
- name: Clone & Build knowhow-common dependency
run: |
BRANCH_TO_CLONE="${{ github.event.inputs.knowhow_common_branch }}"
git clone --branch $BRANCH_TO_CLONE https://github.com/PublicisSapient/knowhow-common.git
cd knowhow-common
mvn clean install -Ddockerfile.skip=true
- name: Get common version using Maven Help Plugin
run: |
cd knowhow-common
COMMON_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "COMMON_VERSION=$COMMON_VERSION"
echo "COMMON_VERSION=$COMMON_VERSION" >> $GITHUB_ENV
- name: Updating the common version in processor project
run: |
mvn versions:use-dep-version \
-Dincludes=com.publicissapient.kpidashboard:common \
-DdepVersion=$COMMON_VERSION \
-DforceVersion=true
# ✅ Code Formatting Check (Spotless)
- name: Code Formatting Check
run: mvn spotless:check
- name: Build & Skip Test Processor
if: ${{ github.event.inputs.test == 'false' }}
run: |
mvn clean install -Ddockerfile.skip=true -DskipTests
- name: Build & Test Processor
if: ${{ github.event.inputs.test == 'true' }}
run: |
mvn clean install -Ddockerfile.skip=true
- name: SonarQube Analysis - Processors
if: ${{ github.event.inputs.test == 'true' }}
run: |
mvn sonar:sonar -Dsonar.projectKey=ENGINEERING.KPIDASHBOARD.PROCESSORS \
-Dsonar.projectName=ENGINEERING.KPIDASHBOARD.PROCESSORS \
-Dsonar.branch.name=${{ env.GITHUB_HEAD_NAME }} \
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} \
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }} -f pom.xml
- name: Check SonarQube Quality Gate
if: ${{ github.event.inputs.test == 'true' }}
run: |
chmod +x SonarQG.sh
./SonarQG.sh ./target/sonar/report-task.txt
- name: Build & Push Jira Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'jira' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$JIRA_NAME:$IMAGE_TAG jira/.
docker push $ACR_LOGIN_SERVER/$JIRA_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push DevOps Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$DEVOPS_NAME:$IMAGE_TAG -f devops-processor-startup/Dockerfile .
docker push $ACR_LOGIN_SERVER/$DEVOPS_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push Rally Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'rally-processor' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$RALLY_NAME:$IMAGE_TAG rally/.
docker push $ACR_LOGIN_SERVER/$RALLY_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push AzureBoard Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azureboard' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$AZUREBOARD_NAME:$IMAGE_TAG azure-boards/.
docker push $ACR_LOGIN_SERVER/$AZUREBOARD_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push Azure Pipeline repo Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azurepipelines' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$AZUREPIPELINE_NAME:$IMAGE_TAG -f azure-pipeline-repo-processor-startup/Dockerfile .
docker push $ACR_LOGIN_SERVER/$AZUREPIPELINE_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push SCM Processor Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'scm-processor' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$SCM_NAME:$IMAGE_TAG knowhow-scm-processor/.
docker push $ACR_LOGIN_SERVER/$SCM_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build & Push AI Data Processor Docker Image
if: ${{ github.event.inputs.processor == 'all' || github.event.inputs.processor == 'ai-data-processor' }}
run: |
docker login $ACR_LOGIN_SERVER --username ${{ secrets.SPEEDTOOLS_ACR_USERNAME }} --password ${{ secrets.SPEEDTOOLS_ACR_PASSWORD }}
docker build -t $ACR_LOGIN_SERVER/$AI_DATA_PROCESSOR_NAME:$IMAGE_TAG ai-data-processor/.
docker push $ACR_LOGIN_SERVER/$AI_DATA_PROCESSOR_NAME:$IMAGE_TAG
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Checkout Helm charts repo
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'jira' || github.event.inputs.processor == 'devops' || github.event.inputs.processor == 'azureboard' || github.event.inputs.processor == 'azurepipelines' || github.event.inputs.processor == 'scm-processor' || github.event.inputs.processor == 'rally-processor' || github.event.inputs.processor == 'ai-data-processor' ) }}
run: |
git clone ${{ secrets.SPEEDTOOLS_BITBUCKET_HELM_REPO }}
- name: Update Jira Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'jira' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$JIRA_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update devops Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$DEVOPS_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update azure board Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azureboard' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$AZUREBOARD_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update azure pipeline Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azurepipelines' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$AZUREPIPELINE_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update scm Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'scm-processor' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$SCM_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update AI Data Processor Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'ai-data-processor' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$AI_DATA_PROCESSOR_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
- name: Update Rally Processor Helm values with new image tag
if: ${{ github.event.inputs.deploy == 'true' && ( github.event.inputs.processor == 'all' || github.event.inputs.processor == 'rally-processor' ) }}
run: |
cd build-configurations/KnowHOW-Deploy/$RALLY_NAME
# Update values.yaml image tag
yq -i ".image.tag = \"${IMAGE_TAG}\"" $VALUES_FILE
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add $VALUES_FILE
git diff --cached --quiet || git commit -m "Update image tag values to ${IMAGE_TAG}"
git push origin HEAD
deploy-jira:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'jira') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy Jira Processor
run: |
argocd app sync $JIRA_NAME-${{ github.event.inputs.env }}
argocd app wait $JIRA_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-rally:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'rally-processor') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy Rally Processor
run: |
argocd app sync $RALLY_NAME-${{ github.event.inputs.env }}
argocd app wait $RALLY_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-az-board:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azureboard') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy Azure Board Processor
run: |
argocd app sync $AZUREBOARD_NAME-${{ github.event.inputs.env }}
argocd app wait $AZUREBOARD_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-az-pipeline:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'azurepipelines') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy Azure Pipeline Processor
run: |
argocd app sync $AZUREPIPELINE_NAME-${{ github.event.inputs.env }}
argocd app wait $AZUREPIPELINE_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-scm-processor:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'scm-processor') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy SCM Processor
run: |
argocd app sync $SCM_NAME-${{ github.event.inputs.env }}
argocd app wait $SCM_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-ai-processor:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'ai-data-processor') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy AI Data Processor
run: |
argocd app sync $AI_DATA_PROCESSOR_NAME-${{ github.event.inputs.env }}
argocd app wait $AI_DATA_PROCESSOR_NAME-${{ github.event.inputs.env }} --health --timeout 300
deploy-devops:
runs-on: github-actions-self-hosted-runner
timeout-minutes: 30
needs: [build]
if: ${{ github.event.inputs.deploy == 'true' && (github.event.inputs.processor == 'all' || github.event.inputs.processor == 'devops') }}
steps:
- name: Install ArgoCD CLI
run: |
export ARGO_PATH="$HOME/bin"
mkdir -p $ARGO_PATH
curl -sSL -o "$ARGO_PATH/argocd" https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x "$ARGO_PATH/argocd"
echo "$ARGO_PATH" >> $GITHUB_PATH
- name: ArgoCD CLI Login
run: |
argocd login argocd-server \
--username ${{ secrets.SPEEDTOOLS_ARGOCD_USERNAME}} \
--password ${{ secrets.SPEEDTOOLS_ARGOCD_PASSWORD }} \
--plaintext
- name: Deploy DevOps Processor
run: |
argocd app sync $DEVOPS_NAME-${{ github.event.inputs.env }}
argocd app wait $DEVOPS_NAME-${{ github.event.inputs.env }} --health --timeout 1200