-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline1.yaml
2924 lines (2338 loc) · 111 KB
/
pipeline1.yaml
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
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: cp4i-demo
namespace: default
spec:
workspaces:
- name: cp4i-ws
finally:
- name: output-usage
params:
- name: SCRIPT
value: >-
oc delete configmap/pipeline-cp4i-demo-output -n default --ignore-not-found=true
oc delete configmap/pipeline-ea-demo-output -n default --ignore-not-found=true
oc delete configmap/pipeline-lsr-demo-output -n default --ignore-not-found=true
if [[ "$(tasks.setup-workspace.results.output)" = "true" ]]
then
CP4I_URL=$(oc get platformnavigator cp4i-navigator -n $(params.CP4I_NAMESPACE) -o jsonpath='{range .status.endpoints[?(@.name=="navigator")]}{.uri}{end}')
CP4I_ADMIN_USER=$(oc get secret integration-admin-initial-temporary-credentials -n ibm-common-services -o jsonpath={.data.username} | base64 -d && echo)
CP4I_ADMIN_INITIAL_PWD=$(oc get secret integration-admin-initial-temporary-credentials -n ibm-common-services -o jsonpath={.data.password} | base64 -d && echo)
echo "----------------------------"
echo "CP4I Platform UI..."
echo " UI URL: " $CP4I_URL
echo " Admin user: " $CP4I_ADMIN_USER
echo " Admin initial password: " $CP4I_ADMIN_INITIAL_PWD
echo "----------------------------"
oc create configmap pipeline-cp4i-demo-output -n default
oc patch configmap/pipeline-cp4i-demo-output -p "{\"data\":{\"msg\":\"Pipeline CP4I Demo run completed\",\"cp4i-url\":\"${CP4I_URL}\",\"cp4i-admin-username\":\"${CP4I_ADMIN_USER}\",\"cp4i-admin-initial-password\":\"${CP4I_ADMIN_INITIAL_PWD}\"}}"
if [[ "$(params.DEPLOY_EVENT_ENDPOINT_MANAGEMENT)" == "true" ]] &&
[[ "$(params.DEPLOY_EVENT_ENDPOINT_MANAGEMENT_OPERATOR)" == "true" ]]; then
EEM_URL=$(oc get eventendpointmanagement eem-demo-mgr -n $(params.CP4I_NAMESPACE) -o jsonpath='{range .status.endpoints[?(@.name=="ui")]}{.uri}{end}')
if [[ -z "$(params.EEM_ADMIN_PWD)" ]] || [[ -z "$(params.EEM_USER_PWD)" ]]; then
EEM_ADMIN_USER=${CP4I_ADMIN_USER}
EEM_ADMIN_PASSWORD=${CP4I_ADMIN_INITIAL_PWD}
else
EEM_ADMIN_USER='eem-admin'
EEM_ADMIN_PASSWORD=$(params.EEM_ADMIN_PWD)
fi
else
EEM_URL='n/a - EEM was not installed per user request.'
EEM_ADMIN_USER='n/a - EEM was not installed per user request.'
EEM_ADMIN_PASSWORD='n/a - EEM was not installed per user request.'
fi
if [[ "$(params.DEPLOY_EA_FLINK_OPERATOR)" == "true" ]] &&
[[ "$(params.DEPLOY_EA_FLINK)" == "true" ]] &&
[[ "$(params.DEPLOY_EVENT_PROCESSING)" == "true" ]] &&
[[ "$(params.DEPLOY_EVENT_PROCESSING_OPERATOR)" == "true" ]]; then
EP_URL=$(oc get eventprocessing ep-demo -n $(params.CP4I_NAMESPACE) -o jsonpath='{range .status.endpoints[?(@.name=="ui")]}{.uri}{end}')
if [[ -z "$(params.EP_ADMIN_PWD)" ]]; then
EP_ADMIN_USER=${CP4I_ADMIN_USER}
EP_ADMIN_PASSWORD=${CP4I_ADMIN_INITIAL_PWD}
else
EP_ADMIN_USER='ep-admin'
EP_ADMIN_PASSWORD=$(params.EP_ADMIN_PWD)
fi
else
EP_URL='n/a - EP was not installed per user request.'
EP_ADMIN_USER='n/a - EP was not installed per user request.'
EP_ADMIN_PASSWORD='n/a - EP was not installed per user request.'
fi
if [[ "$(params.DEPLOY_EA_POSTGRESQL)" == "true" ]] &&
[[ "$(params.DEPLOY_EA_POSTGRESQL_OPERATOR)" == "true" ]]; then
JDBC_URI=$(oc get secret pgsqldemo-pguser-demouser -n $(params.CP4I_NAMESPACE) -o jsonpath='{.data.jdbc\-uri}' | base64 -d)
else
JDBC_URI='n/a - PGSQL was not installed per user request.'
fi
echo "----------------------------"
echo "Event EndPoint Management..."
echo " UI URL:" $EEM_URL
echo " Admin user:" $EEM_ADMIN_USER
echo " Admin password:" $EEM_ADMIN_PASSWORD
echo "Event Processing..."
echo " UI URL:" $EP_URL
echo " Admin user:" $EP_ADMIN_USER
echo " Admin password:" $EP_ADMIN_PASSWORD
echo "PostgreSQL Database..."
echo " JDBC URI:" $JDBC_URI
echo "----------------------------"
oc create configmap pipeline-ea-demo-output -n default
oc patch configmap/pipeline-ea-demo-output -p "{\"data\":{\"msg\":\"Pipeline CP4I Demo run completed\",\"eem-url\":\"${EEM_URL}\",\"eem-admin-username\":\"${EEM_ADMIN_USER}\",\"eem-admin-password\":\"${EEM_ADMIN_PASSWORD}\",\"ep-url\":\"${EP_URL}\",\"ep-admin-username\":\"${EP_ADMIN_USER}\",\"ep-admin-password\":\"${EP_ADMIN_PASSWORD}\",\"jdbc-uri\":\"${JDBC_URI}\"}}"
if [[ "$(params.DEPLOY_LICENSE_REPORTER)" == "true" ]] &&
[[ "$(params.DEPLOY_LICENSE_SERVICE)" == "true" ]]; then
LSR_HOST=$(oc get route ibm-lsr-console -n ibm-licensing -o jsonpath={.spec.host})
LSR_PATH=$(oc get route ibm-lsr-console -n ibm-licensing -o jsonpath={.spec.path})
LSR_URL="https://"$LSR_HOST$LSR_PATH
LSR_USER_NAME=$(oc get secret ibm-license-service-reporter-credentials -o jsonpath={.data.username} -n ibm-licensing | base64 -d)
LSR_USER_PWD=$(oc get secret ibm-license-service-reporter-credentials -o jsonpath={.data.password} -n ibm-licensing | base64 -d)
echo "----------------------------"
echo "License Service Reporter Dashboard..."
echo " Dashboard URL: " $LSR_URL
echo " Admin user: " $LSR_USER_NAME
echo " Admin initial password: " $LSR_USER_PWD
echo "----------------------------"
oc create configmap pipeline-lsr-demo-output -n default
oc patch configmap/pipeline-lsr-demo-output -p "{\"data\":{\"msg\":\"Pipeline CP4I Demo run completed\",\"lsr-url\":\"${LSR_URL}\",\"lsr-admin-username\":\"${LSR_USER_NAME}\",\"lsr-admin-password\":\"${LSR_USER_PWD}\"}}"
else
echo "----------------------------"
echo "License Service Reporter was not installed per user request."
echo "----------------------------"
oc create configmap pipeline-lsr-demo-output -n default
oc patch configmap/pipeline-lsr-demo-output -p "{\"data\":{\"msg\":\"Pipeline CP4I Demo run completed, but License Service Reporter was not installed per user request.\"}}"
fi
else
echo "----------------------------"
echo "Pipeline CP4I Demo couldn't run successfully."
echo "Check the logs in setup-workspace task for more details."
echo "----------------------------"
oc create configmap pipeline-cp4i-demo-output -n default
oc patch configmap/pipeline-cp4i-demo-output -p "{\"data\":{\"msg\":\"Pipeline CP4I Demo couldn't run. Check the logs in setup-workspace task for more details.\"}}"
fi
- name: VERSION
value: latest
taskRef:
kind: Task
name: jgr-task-0.2
params:
- name: CP4I_NAMESPACE
default: tools
description: Namespace to deploy Platform UI
type: string
- name: ACE_NAMESPACE
default: tools
description: Namespace to deploy App Connect assets
type: string
- name: ES_NAMESPACE
default: tools
description: Namespace to deploy Event Streams assets
type: string
- name: CP4I_VERSION
default: 16.1.0
description: Version of CP4I Platform UI to deploy
type: string
- name: MQ_VERSION
default: 9.4.0.6-r1
description: Version of MQ to deploy
type: string
- name: DEFAULT_SC
default: ocs-storagecluster-ceph-rbd
description: Default Storage Class for Cluster
type: string
- name: OCP_BLOCK_STORAGE
default: ocs-storagecluster-ceph-rbd
description: Block Storage Class for Cluster
type: string
- name: OCP_FILE_STORAGE
default: ocs-storagecluster-cephfs
description: File Storage Class for Cluster
type: string
- name: MAILTRAP_USER
default: ''
description: User to configure mail server
type: string
- name: MAILTRAP_PWD
default: ''
description: Password to configure mail server
type: string
- name: EEM_APIC_INT
default: 'true'
description: EEM integration with APIC flag
type: string
- name: EA_WATSONX
default: 'true'
description: Enable assets to demo integration with WatsonX
type: string
- name: DEPLOY_LICENSE_SERVICE
default: 'false'
description: Deploy License Service resources
type: string
- name: DEPLOY_LICENSE_REPORTER
default: 'false'
description: Deploy License Service resources
type: string
- name: DEPLOY_ASSET_REPOSITORY_OPERATOR
default: 'true'
description: Deploy Asset repository operator
type: string
- name: DEPLOY_DATAPOWER_GATEWAY_OPERATOR
default: 'true'
description: Deploy DataPower Gateway operator
type: string
- name: DEPLOY_API_CONNECT_OPERATOR
default: 'true'
description: Deploy API Connect operator
type: string
- name: DEPLOY_APP_CONNECT_OPERATOR
default: 'true'
description: Deploy App Connect operator
type: string
- name: DEPLOY_MQ_OPERATOR
default: 'true'
description: Deploy MQ operator
type: string
- name: DEPLOY_ASPERA_HSTS_OPERATOR
default: 'false'
description: Deploy Aspera HSTS operator
type: string
- name: DEPLOY_EVENT_STREAMS_OPERATOR
default: 'true'
description: Deploy Event Streams operator
type: string
- name: DEPLOY_EVENT_ENDPOINT_MANAGEMENT_OPERATOR
default: 'true'
description: Deploy Event Endpoint Management operator
type: string
- name: DEPLOY_EA_FLINK_OPERATOR
default: 'true'
description: Deploy Flink operator
type: string
- name: DEPLOY_EVENT_PROCESSING_OPERATOR
default: 'true'
description: Deploy Event Processing operator
type: string
- name: DEPLOY_EA_POSTGRESQL_OPERATOR
default: 'true'
description: Deploy PostgreSQL operator
type: string
- name: IBM_ENTITLEMENT_KEY_ID
default: a65ac528-bbca-1425-8d07-fde9e2f1ff70
type: string
- name: DEPLOY_PLATFORM_UI
default: 'true'
description: Deploy platform UI
type: string
- name: DEPLOY_ASSET_REPO
default: 'true'
description: Deploy asset repo
type: string
- name: ASSET_REPO_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: Platform UI storage class (RWX)
type: string
- name: DEPLOY_API_CONNECT
default: 'true'
description: Deploy apiconnect
type: string
- name: APICONNECT_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: Platform UI storage class (RWX)
type: string
- name: DEPLOY_EVENT_STREAMS
default: 'true'
description: Deploy event streams
type: string
- name: ES_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: Event Streams storage class (RWO)
type: string
- name: DEPLOY_EVENT_ENDPOINT_MANAGEMENT
default: 'true'
description: Deploy event endpoint management
type: string
- name: EEM_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: EEM Manager storage class (RWO)
type: string
- name: EEM_ADMIN_PWD
default: ''
description: EEM Admin user password
type: string
- name: EEM_USER_PWD
default: ''
description: EEM Regular user password
type: string
- name: DEPLOY_QUEUE_MANAGER
default: 'true'
description: Deploy queue manager
type: string
- name: MQ_BLOCK_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: Queue Manager storage class (RWO)
type: string
- name: DEPLOY_ACE_SWITCH_SERVER
default: 'true'
description: Deploy ACE Switch Server
type: string
- name: DEPLOY_ACE_DESIGNER
default: 'true'
description: Deploy ACE Designer
type: string
- name: ACE_DESIGNER_BLOCK_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: ACE Dashboard storage class (RWO)
type: string
- name: ACE_DESIGNER_FILE_STORAGE_CLASS
default: ocs-storagecluster-cephfs
description: ACE Dashboard storage class (RWX)
type: string
- name: DEPLOY_ACE_DASHBOARD
default: 'true'
description: Deploy ACE Dashboard
type: string
- name: ACE_DASHBOARD_STORAGE_CLASS
default: ocs-storagecluster-cephfs
description: ACE Dashboard storage class (RWX)
type: string
- name: DEPLOY_ACE_INTEGRATION_SERVER
default: 'true'
description: Deploy ACE Integration Server
type: string
- name: DEPLOY_EA_FLINK
default: 'true'
description: Deploy apache flink
type: string
- name: DEPLOY_EVENT_PROCESSING
default: 'true'
description: Deploy event processing
type: string
- name: EP_STORAGE_CLASS
default: ocs-storagecluster-ceph-rbd
description: Event processing storage class (RWX)
type: string
- name: EP_ADMIN_PWD
default: ''
description: EP Admin user password
type: string
- name: DEPLOY_EA_POSTGRESQL
default: 'true'
description: Deploy postgresql
type: string
- name: REPO_SIGNATURE
default: 'JGR-20241201-002'
description: CP4I Deployer Helper Repo Signature
type: string
- name: IBM_SECRETS_MANAGER_ENDPOINT
default: >-
https://afa20521-cd75-4864-843f-e59fd0ffd49d.us-south.secrets-manager.appdomain.cloud
type: string
- name: COPY_TLS_CERTS
default: 'true'
type: string
tasks:
- name: setup-workspace
params:
- name: SCRIPT
value: >-
set -o xtrace
echo "Setting up workspace for pipeline"
cd workspace/cp4i-ws
git clone --single-branch --branch main https://github.com/gomezrjo/cp4i-deployer-helper.git
echo "Checking helper repo."
if grep -q "$(params.REPO_SIGNATURE)" cp4i-deployer-helper/signature; then
echo "Valid signature in helper repo."
else
echo "Helper repo is out of sync, update this repo."
printf false | tee $(results.output.path)
exit 0
fi
echo "Checking SC provided in parameter DEFAULT_SC"
SC_EXIST=$(oc get sc --no-headers | awk -v sc_name=$(params.DEFAULT_SC) '$1 == sc_name {print "yes"}')
if [[ -z $SC_EXIST ]]; then
echo "SC does NOT exist"
printf false | tee $(results.output.path)
exit 0
else
echo "SC found"
fi
echo "Checking SC provided in parameter OCP_BLOCK_STORAGE"
SC_EXIST=$(oc get sc --no-headers | awk -v sc_name=$(params.OCP_BLOCK_STORAGE) '$1 == sc_name {print "yes"}')
if [[ -z $SC_EXIST ]]; then
echo "SC does NOT exist"
printf false | tee $(results.output.path)
exit 0
else
echo "SC found"
fi
echo "Checking SC provided in parameter OCP_FILE_STORAGE"
SC_EXIST=$(oc get sc --no-headers | awk -v sc_name=$(params.OCP_FILE_STORAGE) '$1 == sc_name {print "yes"}')
if [[ -z $SC_EXIST ]]; then
echo "SC does NOT exist"
printf false | tee $(results.output.path)
exit 0
else
echo "SC found"
fi
printf true | tee $(results.output.path)
tar -xvzf cp4i-deployer-helper/extras/toolkit-linux.tgz
chmod +x apic
echo "Workspace for pipeline is ready"
- name: VERSION
value: latest
retries: 3
taskRef:
kind: Task
name: jgr-task-0.2
timeout: 3h0m0s
workspaces:
- name: cp4i-ws
- name: set-default-storage-class
params:
- name: SCRIPT
value: >-
set -o xtrace
echo "Setting default storage class"
cd workspace/cp4i-ws/cp4i-deployer-helper
if [[ $(oc get sc | grep default | wc -l) -gt 0 ]]; then
oc get sc | grep default | awk '{system("oc patch storageclass " $1 " --patch-file resources/99-sc-remove-default.yaml")}'
fi
oc patch storageclass $(params.DEFAULT_SC) --patch-file resources/99-sc-set-default.yaml
- name: VERSION
value: latest
retries: 3
runAfter:
- setup-workspace
taskRef:
kind: Task
name: jgr-task-0.2
timeout: 3h0m0s
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: cert-mgr-operator-installation
params:
- name: SCRIPT
value: |-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Creating a new namespace called cert-manager-operator"
if [[ $(oc get projects | grep cert-manager-operator | wc -l) -eq 0 ]]; then
oc apply -f resources/00-cert-manager-namespace.yaml
fi
echo "Creating operator group for cert-manager-operator namespace"
oc apply -f resources/00-cert-manager-operatorgroup.yaml
echo "Creating subscription for cert-manager-operator"
oc apply -f resources/00-cert-manager-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment cert-manager-operator-controller-manager -n cert-manager-operator --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Waiting for cert manager operator to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Succeeded csv/$SUB_NAME -n cert-manager-operator 2>/dev/null; do sleep 30; done
echo "Cert manager operator is ready."
- name: VERSION
value: latest
runAfter:
- set-default-storage-class
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: create-cp4i-base-namespaces
params:
- name: SCRIPT
value: |-
set -o xtrace
CP4I_NAMESPACES=($(params.CP4I_NAMESPACE) $(params.ACE_NAMESPACE) $(params.ES_NAMESPACE))
for NS in "${CP4I_NAMESPACES[@]}"
do
echo "Creating a new namespace called" $NS
if [[ -z "$(oc projects -q | awk -v ns=$NS '$1 == ns {print $1}')" ]]; then
oc new-project $NS
else
echo "Namespace" $NS "already exists."
fi
done
echo "Namespaces are ready"
- name: VERSION
value: latest
runAfter:
- cert-mgr-operator-installation
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- name: get-entitlement-key
params:
- name: KEY_ID
value: $(params.IBM_ENTITLEMENT_KEY_ID)
- name: SECRETS_MANAGER_ENDPOINT_URL
value: $(params.IBM_SECRETS_MANAGER_ENDPOINT)
runAfter:
- create-cp4i-base-namespaces
taskRef:
kind: Task
name: ibmcloud-secrets-manager-get
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- name: create-ibm-entitlement-key
params:
- name: SCRIPT
value: >-
set -o xtrace
CP4I_NAMESPACES=($(params.CP4I_NAMESPACE) $(params.ACE_NAMESPACE) $(params.ES_NAMESPACE))
for NS in "${CP4I_NAMESPACES[@]}"
do
if oc get secret ibm-entitlement-key -n $NS >/dev/null 2>&1; then
username=$(oc get secret ibm-entitlement-key -n $NS -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d | jq -r '.auths."cp.icr.io".username')
password=$(oc get secret ibm-entitlement-key -n $NS -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d | jq -r '.auths."cp.icr.io".password')
if [[ "$username" == "cp" ]] && [[ "$password" == "$(tasks.get-entitlement-key.results.secret-value)" ]]; then
echo "Secret ibm-entitlement-key was already created. Skipping secret creation"
exit 0
else
echo "Existing ibm-entitlement-key password does not match retrieved key. Deleting..."
oc delete secret ibm-entitlement-key -n $NS --ignore-not-found=true
echo "Creating new ibm-entitlement-key secret"
oc create secret docker-registry ibm-entitlement-key \
--docker-username=cp \
--docker-password=$(tasks.get-entitlement-key.results.secret-value) \
--docker-server=cp.icr.io \
--namespace=$NS
fi
else
echo "Creating new ibm-entitlement-key secret"
oc create secret docker-registry ibm-entitlement-key \
--docker-username=cp \
--docker-password=$(tasks.get-entitlement-key.results.secret-value) \
--docker-server=cp.icr.io \
--namespace=$NS
fi
done
- name: VERSION
value: latest
runAfter:
- get-entitlement-key
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- name: cluster-issuer-deployment
params:
- name: SCRIPT
value: |-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Wating for Cert Manager WebHook to be present..."
while ! oc get service cert-manager-webhook -n cert-manager 2>/dev/null; do echo "Waiting for webhook."; sleep 2; done
echo "Deploying cluster issuer..."
oc apply -f resources/00-gitops-clusterissuer.yaml
while ! oc wait --for=jsonpath='{.status.conditions[0].status}'=True clusterissuer/selfsigned-issuer 2>/dev/null; do sleep 30; done
echo "Cluster Issuer is ready."
- name: VERSION
value: latest
runAfter:
- create-ibm-entitlement-key
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: common-services-operator-installation
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Creating common services namespace"
if [[ $(oc get projects | grep ibm-common-services | wc -l) -eq 0 ]]; then
oc create namespace ibm-common-services
fi
echo "Enabling postgresql catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/01-postgress-sql-catalog-source.yaml
echo "Waiting for postgresql catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/cloud-native-postgresql-catalog -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "PostgreSQL catalog source is ready"
echo "Enabling common services catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/02-common-services-catalog-source.yaml
echo "Waiting for common services catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/opencloud-operators -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "Common services catalog source is ready"
echo "Installing common services operator"
oc apply -f subscriptions/$(params.CP4I_VERSION)/00-common-service-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment/ibm-common-service-operator -n openshift-operators --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Operator: " $SUB_NAME
echo "Waiting for common services operator to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Succeeded
csv/$SUB_NAME 2>/dev/null; do sleep 30; done
echo "Common services operator is ready"
- name: VERSION
value: latest
runAfter:
- cluster-issuer-deployment
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: cp4i-operator-installation
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Enabling platform navigator catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/03-platform-navigator-catalog-source.yaml
echo "Waiting for platform navigator catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/ibm-integration-platform-navigator-catalog -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "Platform navigator catalog source is ready"
echo "Installing platform navigator operator"
oc apply -f subscriptions/$(params.CP4I_VERSION)/01-platform-navigator-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment ibm-integration-platform-navigator-operator -n openshift-operators --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Operator: " $SUB_NAME
echo "Waiting for platform navigator operator to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Succeeded
csv/$SUB_NAME 2>/dev/null; do sleep 30; done
echo "Platform navigator operator is ready"
- name: VERSION
value: latest
runAfter:
- common-services-operator-installation
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: platform-navigator-deployment
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Deploying platform navigator instance"
oc apply -f instances/$(params.CP4I_VERSION)/01-platform-navigator-instance.yaml -n
$(params.CP4I_NAMESPACE)
echo "Waiting for platform navigator instance to be ready..."
while ! oc wait --for=condition=Ready
PlatformNavigator/cp4i-navigator -n
$(params.CP4I_NAMESPACE) 2>/dev/null; do sleep 30; done
echo "Platform navigator instance is ready"
- name: VERSION
value: latest
runAfter:
- cp4i-operator-installation
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_PLATFORM_UI)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: asset-repository-operator-installation
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Enabling asset reposiroty catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/04-asset-repo-catalog-source.yaml
echo "Waiting for asset repository catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/ibm-integration-asset-repository-catalog -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "Asset repository catalog source is ready"
echo "Installing asset repository operator"
oc apply -f subscriptions/$(params.CP4I_VERSION)/02-asset-repo-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment ibm-integration-asset-repository-operator -n openshift-operators --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Operator: " $SUB_NAME
echo "Waiting for asset repository operator to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Succeeded
csv/$SUB_NAME 2>/dev/null; do sleep 30; done
echo "Asset repository operator is ready"
- name: VERSION
value: latest
runAfter:
- platform-navigator-deployment
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_ASSET_REPOSITORY_OPERATOR)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: asset-repository-instance-deployment
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Preparing asset repo instance manifest"
(echo "cat <<EOF" ; cat instances/$(params.CP4I_VERSION)/02-asset-repo-ai-instance.yaml ;) | \
OCP_BLOCK_STORAGE=$(params.OCP_BLOCK_STORAGE) \
sh > asset-repo-ai-instance.yaml
echo "Deploying asset repository instance"
oc apply -f asset-repo-ai-instance.yaml -n
$(params.CP4I_NAMESPACE)
echo "Waiting for asset repository instance to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Ready
AssetRepository/asset-repo-ai -n
$(params.CP4I_NAMESPACE) 2>/dev/null; do sleep 30; done
echo "Asset repository instance is ready"
- name: VERSION
value: latest
runAfter:
- asset-repository-operator-installation
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_ASSET_REPOSITORY_OPERATOR)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_ASSET_REPO)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_PLATFORM_UI)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: datapower-operator-installation
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Enabling datapower catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/05-datapower-catalog-source.yaml
echo "Waiting for datapower catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/ibm-datapower-operator-catalog -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "Datapower catalog source is ready"
echo "Installing datapower operator"
oc apply -f subscriptions/$(params.CP4I_VERSION)/03-datapower-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment datapower-operator -n openshift-operators --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Operator: " $SUB_NAME
echo "Waiting for datapower operator to be ready..."
while ! oc wait --for=jsonpath='{.status.phase}'=Succeeded
csv/$SUB_NAME 2>/dev/null; do sleep 30; done
echo "Datapower operator is ready"
- name: VERSION
value: latest
runAfter:
- asset-repository-instance-deployment
taskRef:
kind: Task
name: jgr-task-0.2
when:
- input: "$(tasks.setup-workspace.results.output)"
operator: in
values: ["true"]
- input: "$(params.DEPLOY_DATAPOWER_GATEWAY_OPERATOR)"
operator: in
values: ["true"]
workspaces:
- name: cp4i-ws
- name: apic-operator-installation
params:
- name: SCRIPT
value: >-
set -o xtrace
cd workspace/cp4i-ws/cp4i-deployer-helper
echo "Enabling apic catalog source"
oc apply -f catalog-sources/$(params.CP4I_VERSION)/07-api-connect-catalog-source.yaml
echo "Waiting for apic catalog source to be ready..."
while ! oc wait --for=jsonpath='{.status.connectionState.lastObservedState}'=READY
catalogsources/ibm-apiconnect-catalog -n
openshift-marketplace 2>/dev/null; do sleep 30; done
echo "APIC catalog source is ready"
echo "Installing apic operator"
oc apply -f subscriptions/$(params.CP4I_VERSION)/04-api-connect-subscription.yaml
echo "Getting operator version..."
SUB_NAME=''
while [ -z "$SUB_NAME" ]; do sleep 5; SUB_NAME=$(oc get deployment ibm-apiconnect -n openshift-operators --ignore-not-found -o jsonpath='{.metadata.labels.olm\.owner}'); done
echo "Operator: " $SUB_NAME
echo "Waiting for apic operator to be ready..."