This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
/
devtools-ci-index.yaml
4960 lines (4694 loc) · 184 KB
/
devtools-ci-index.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
- defaults:
name: global
timeout: '15m'
jobdescription: "Managed by Jenkins Job Builder, do not edit manually! Update via https://github.com/openshiftio/openshiftio-cico-jobs"
git_organization: fabric8-services
github_user: almighty-bot
github_hooks: true
branch: master
discarder_days: -1
discarder_num: -1
build_branch: master
manifest_bouncer_tag: d21c96f
- admin_list_defaults: &admin_list_defaults
name: 'admin_list_defaults'
admin-list:
- aditya-konarde
- akurinnoy
- alexeykazakov
- amisevsk
- andrewazores
- aptmac
- arajkumar
- artaleks9
- ashumilova
- aslakknutsen
- baijum
- bartoszmajsak
- chmouel
- chrislessard
- christianvogt
- davidfestal
- deepak1725
- dependabot[bot]
- dependabot-preview[bot]
- dgutride
- DhritiShikhar
- dipak-pawar
- dipanjanS
- dlabrecq
- dmytro-ndp
- ebaron
- edewit
- evidolob
- fabric8cd
- fche
- gastaldi
- hrishin
- ia3andy
- ibuziuk
- inoxx03
- invincibleJai
- jfchevrette
- jiekang
- jmelis
- joshuawilson
- Katka92
- kbsingh
- khrm
- kwk
- l0rd
- ldimaggi
- ljelinkova
- maorfr
- MatousJobanek
- maxandersen
- michaelkleinhenz
- mindreeper2420
- miteshvp
- mmclanerh
- msrb
- musienko-maxim
- neugens
- nimishamukherjee
- nurali-techie
- Ohrimenko1988
- pbergene
- piyush-garg
- pmacik
- ppitonak
- Preeticp
- quintesse
- rhopp
- rkratky
- rohitkrai03
- rohanKanojia
- rupalibehera
- sahil143
- samuzzal-choudhury
- sanketpathak
- sbose78
- sbryzak
- ScrewTSW
- skabashnyuk
- SkorikSergey
- skryzhny
- sthaha
- stooke
- tinakurian
- tisnik
- tradej
- tsmaeder
- vikram-raj
- vparfonov
- xcoulon
- sivaavkd
- yzainee
- flacatus
- github_pull_request_defaults: &github_pull_request_defaults
name: 'github_pull_request_defaults'
<<: *admin_list_defaults
cron: '* * * * *'
github-hooks: '{github_hooks}'
permit-all: false
trigger-phrase: '.*\[test\].*'
allow-whitelist-orgs-as-admins: true
status-context: "ci.centos.org PR build"
- trigger:
name: githubprb
triggers:
- github-pull-request:
<<: *github_pull_request_defaults
- scm:
name: git-scm
scm:
- git:
credentials-id: "c4872223-4024-4cd4-8e09-1bbdc7d6e971"
url: "{git_url}"
skip-tag: True
git-tool: ci-git
refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
branches:
- '${{ghprbActualCommit}}'
basedir: '{git_basedir}'
- vault_defaults: &vault_defaults
name: 'vault_defaults'
vault-url: 'https://vault.devshift.net'
credentials-id: '52ce5cda-e8f3-47a7-917b-8771518b4729'
- kube-config-dsaas-stg: &kube-config-dsaas-stg
name: "kube-config-dsaas-stg"
secret-path: 'app-sre/creds/kube-configs/dsaas-stg'
secret-values:
- env-var: 'KUBE_SERVER'
vault-key: 'server'
- env-var: 'KUBE_TOKEN'
vault-key: 'token'
- kube-config-dsaas: &kube-config-dsaas
name: "kube-config-dsaas-stg"
secret-path: 'app-sre/creds/kube-configs/dsaas'
secret-values:
- env-var: 'KUBE_SERVER'
vault-key: 'server'
- env-var: 'KUBE_TOKEN'
vault-key: 'token'
- fabric8-planner-test-token: &fabric8-planner-test-token
name: "fabric8-planner-test-token"
secret-path: 'devtools-osio-ci/fabric8-planner-test-token-refresh-token'
secret-values:
- env-var: 'REFRESH_TOKEN'
vault-key: 'token'
- npm-build-deliver-creds-gh-token: &npm-build-deliver-creds-gh-token
name: "npm-build-deliver-creds-gh-token"
secret-path: 'devtools-osio-ci/npm-build-deliver-creds-gh-token'
secret-values:
- env-var: 'GH_TOKEN'
vault-key: 'token'
- npm-build-deliver-creds-npm-token: &npm-build-deliver-creds-npm-token
name: "npm-build-deliver-creds-npm-token"
secret-path: 'devtools-osio-ci/npm-build-deliver-creds-npm-token'
secret-values:
- env-var: 'NPM_TOKEN'
vault-key: 'token'
- fabric8-build-dockerio-dockercfg: &fabric8-build-dockerio-dockercfg
name: "fabric8-build-dockerio-dockercfg"
secret-path: 'devtools-osio-ci/fabric8-build-dockerio-dockercfg'
secret-values:
- env-var: 'FABRIC8_DOCKERIO_CFG'
vault-key: 'config.json'
- fabric8-github-ssh-key: &fabric8-github-ssh-key
name: "fabric8-github-ssh-key"
secret-path: 'devtools-osio-ci/fabric8-github-ssh-key'
secret-values:
- env-var: 'FABRIC8_GITHUB_SSH_KEY'
vault-key: 'ssh-key'
- fabric8-hub-token: &fabric8-hub-token
name: "fabric8-hub-token"
secret-path: 'devtools-osio-ci/fabric8-hub-token'
secret-values:
- env-var: 'FABRIC8_HUB_TOKEN'
vault-key: 'hub'
- fabric8-hub-token: &fabric8-build-devcluster
name: "fabric8-build-devcluster"
secret-path: 'devtools-osio-ci/fabric8-build-devcluster'
secret-values:
- env-var: 'FABRIC8_DEVCLUSTER_TOKEN'
vault-key: 'OS_TOKEN'
- fabric8-maven-settingsxml: &fabric8-maven-settingsxml
name: "fabric8-maven-settingsxml"
secret-path: 'devtools-osio-ci/fabric8-maven-settingsxml'
secret-values:
- env-var: 'FABRIC8_MAVEN_SETTINGS'
vault-key: 'settings.xml'
- registry-devshift-credentials: ®istry-devshift-credentials
name: "registry-devshift-credentials"
secret-path: 'app-sre/cico/registry-devshift-credentials'
secret-values:
- env-var: 'DEVSHIFT_USERNAME'
vault-key: 'devshift_username'
- env-var: 'DEVSHIFT_PASSWORD'
vault-key: 'devshift_password'
- quay-credentials: &quay-credentials
name: "quay-credentials"
secret-path: 'app-sre/cico/quay-credentials'
secret-values:
- env-var: 'QUAY_USERNAME'
vault-key: 'quay_username'
- env-var: 'QUAY_PASSWORD'
vault-key: 'quay_password'
- quay-eclipse-che-credentials: &quay-eclipse-che-credentials
name: "quay-eclipse-che-credentials"
secret-path: 'devtools-osio-ci/quay-eclipse-che-credentials'
secret-values:
- env-var: 'QUAY_ECLIPSE_CHE_USERNAME'
vault-key: 'quay_eclipse_che_username'
- env-var: 'QUAY_ECLIPSE_CHE_PASSWORD'
vault-key: 'quay_eclipse_che_password'
- che-bot-github-credentials: &che-bot-github-credentials
name: "che-bot-github-credentials"
secret-path: "devtools-osio-ci/che-bot-github-token"
secret-values:
- env-var: 'CHE_BOT_GITHUB_TOKEN'
vault-key: 'che-bot-github-token'
- eclipse-che-oss-sonatype: &eclipse-che-oss-sonatype
name: "eclipse-che-oss-sonatype"
secret-path: "devtools-osio-ci/che-oss-sonatype"
secret-values:
- env-var: 'CHE_OSS_SONATYPE_USERNAME'
vault-key: 'che_oss_sonatype_username'
- env-var: 'CHE_OSS_SONATYPE_PASSWORD'
vault-key: 'che_oss_sonatype_password'
- env-var: 'CHE_MAVEN_SETTINGS'
vault-key: 'settings.xml'
- env-var: 'CHE_OSS_SONATYPE_GPG_KEY'
vault-key: 'che_oss_sonatype_gpg_key'
- env-var: 'CHE_OSS_SONATYPE_PASSPHRASE'
vault-key: 'che_oss_sonatype_gpg_passphrase'
- eclipse-che-github-ssh-key: &eclipse-che-github-ssh-key
name: "eclipse-che-github-ssh-key"
secret-path: 'devtools-osio-ci/eclipse-che-github-ssh-key'
secret-values:
- env-var: 'CHE_GITHUB_SSH_KEY'
vault-key: 'che-github-ssh-key'
- osiotestmachine-clean-up-gh-token: &osiotestmachine-clean-up-gh-token
name: "osiotestmachine-clean-up-gh-token"
secret-path: 'devtools-osio-ci/osiotestmachine-clean-up-gh-token'
secret-values:
- env-var: 'GITHUB_TOKEN'
vault-key: 'token'
- copr-mercator-api-token: &copr-mercator-api-token
name: "copr-mercator-api-token"
secret-path: 'devtools-osio-ci/copr-mercator-api-token'
secret-values:
- env-var: 'COPR_LOGIN_MERCATOR'
vault-key: 'login'
- env-var: 'COPR_TOKEN_MERCATOR'
vault-key: 'token'
- rh-che-compatibility-github-credentials: &rh-che-compatibility-github-credentials
name: "rh-che-compatibility-github-credentials"
secret-path: 'devtools-osio-ci/rh-che-compatibility-github-push-token'
secret-values:
- env-var: 'GITHUB_PUSH_TOKEN'
vault-key: 'TOKEN'
- env-var: 'GITHUB_TOKEN_PASSWORD'
vault-key: 'PASSWORD'
- rh-che-automation-credentials-devrdu2c-fabric8-io: &rh-che-automation-credentials-devrdu2c-fabric8-io
name: "rh-che-automation-credentials-devrdu2c-fabric8-io"
secret-path: 'devtools-osio-ci/rh-che-automation-credentials-devrdu2c-fabric8-io'
secret-values:
- env-var: 'RH_CHE_AUTOMATION_RDU2C_USERNAME'
vault-key: 'username'
- env-var: 'RH_CHE_AUTOMATION_RDU2C_PASSWORD'
vault-key: 'password'
- rh-che-automation-credentials-prod-preview-openshift-io: &rh-che-automation-credentials-prod-preview-openshift-io
name: "rh-che-automation-credentials-prod-preview-openshift-io"
secret-path: 'devtools-osio-ci/rh-che-automation-credentials-prod-preview-openshift-io'
secret-values:
- env-var: 'KEYCLOAK_TOKEN'
vault-key: 'keycloak_token'
- env-var: 'RH_CHE_AUTOMATION_CHE_PREVIEW_USERNAME'
vault-key: 'che_preview_username'
- env-var: 'RH_CHE_AUTOMATION_CHE_PREVIEW_PASSWORD'
vault-key: 'che_preview_password'
- env-var: 'RH_CHE_AUTOMATION_CHE_PREVIEW_EMAIL'
vault-key: 'che_preview_email'
- rh-che-automation-credentials-dockerhub: &rh-che-automation-credentials-dockerhub
name: "rh-che-automation-credentials-dockerhub"
secret-path: 'devtools-osio-ci/rh-che-automation-credentials-dockerhub'
secret-values:
- env-var: 'RH_CHE_AUTOMATION_DOCKERHUB_USERNAME'
vault-key: 'username'
- env-var: 'RH_CHE_AUTOMATION_DOCKERHUB_PASSWORD'
vault-key: 'password'
- rhche-flaky-2-creds: &rhche-flaky-2-creds
name: "rhche-flaky-2-creds"
secret-path: 'devtools-osio-ci/rhche-flaky-2-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- rhche-periodic-2-creds: &rhche-periodic-2-creds
name: "rhche-periodic-2-creds"
secret-path: 'devtools-osio-ci/rhche-periodic-2-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- rhche-periodic-2a-creds: &rhche-periodic-2a-creds
name: "rhche-periodic-2a-creds"
secret-path: 'devtools-osio-ci/rhche-periodic-2a-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- rhche-periodic-2aProd-creds: &rhche-periodic-2aProd-creds
name: "rhche-periodic-2aProd-creds"
secret-path: 'devtools-osio-ci/rhche-periodic-2aProd-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- rhche-periodic-1b-creds: &rhche-periodic-1b-creds
name: "rhche-periodic-1b-creds"
secret-path: 'devtools-osio-ci/rhche-periodic-1b-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- rhche-periodic-1a-creds: &rhche-periodic-1a-creds
name: "rhche-periodic-1a-creds"
secret-path: 'devtools-osio-ci/rhche-periodic-1a-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- env-var: 'EMAIL'
vault-key: 'email'
- qe-osio-dev-cluster-SA-token: &qe-osio-dev-cluster-SA-token
name: "qe-osio-dev-cluster-SA-token"
secret-path: "devtools-osio-ci/qe-osio-dev-cluster-SA-token"
secret-values:
- env-var: 'RH_CHE_AUTOMATION_DEV_CLUSTER_SA_TOKEN'
vault-key: 'sa_token'
- fabric8-planner-test-preview-creds: &fabric8-planner-test-preview-creds
name: "fabric8-planner-test-preview-creds"
secret-path: 'devtools-osio-ci/fabric8-planner-test-preview-creds'
secret-values:
- env-var: 'USERNAME'
vault-key: 'username'
- env-var: 'PASSWORD'
vault-key: 'password'
- recommender-api-token: &recommender-api-token
name: "recommender-api-token"
secret-path: 'devtools-osio-ci/recommender-api-token'
secret-values:
- env-var: 'RECOMMENDER_API_TOKEN'
vault-key: 'token'
- 3scale-user-key: &3scale-user-key
name: "3scale-user-key"
secret-path: 'devtools-osio-ci/3scale-user-key'
secret-values:
- env-var: 'THREE_SCALE_PREVIEW_USER_KEY'
vault-key: 'user_key'
- recommender-refresh-token: &recommender-refresh-token
name: "recommender-refresh-token"
secret-path: 'devtools-osio-ci/recommender-refresh-token'
secret-values:
- env-var: 'RECOMMENDER_REFRESH_TOKEN'
vault-key: 'token'
- recommender-api-token-prod: &recommender-api-token-prod
name: "recommender-api-token-prod"
secret-path: 'devtools-osio-ci/recommender-api-token-prod'
secret-values:
- env-var: 'RECOMMENDER_API_TOKEN'
vault-key: 'token'
- fabric8cd-sonatype-creds: &fabric8cd-sonatype-creds
name: "fabric8cd-sonatype-creds"
secret-path: 'devtools-osio-ci/sonatype-creds'
secret-values:
- env-var: 'SONATYPE_USERNAME'
vault-key: 'sonatype_username'
- env-var: 'SONATYPE_PASSWORD'
vault-key: 'sonatype_password'
- gpgkeys-for-signing-maven-artefacts: &gpgkeys-for-signing-maven-artefacts
name: "gpgkeys-for-signing-maven-artefacts"
secret-path: 'devtools-osio-ci/gpgkeys'
secret-values:
- env-var: 'PUBRING'
vault-key: 'pubring.gpg'
- env-var: 'SEC_JENKINS'
vault-key: 'sec-jenkins.gpg'
- env-var: 'SECRING'
vault-key: 'secring.gpg'
- env-var: 'TRUSTDB'
vault-key: 'trustdb.gpg'
- env-var: 'GPG_PASSPHRASE'
vault-key: 'gpg.passphrase'
- che-akamai-cdn-auth: &che-akamai-cdn-auth
name: "che-akamai-cdn-auth"
secret-path: "devtools-osio-ci/akamai-che-auth"
secret-values:
- env-var: 'AKAMAI_CHE_AUTH'
vault-key: 'AKAMAI_CHE_AUTH'
- wrapper:
name: che_credentials_wrapper
wrappers:
- credentials-binding:
- username-password-separated:
credential-id: b2ae0d9a-307a-4df3-b027-9aa0c22e29dd
username: RHCHEBOT_DOCKER_HUB_USERNAME
password: RHCHEBOT_DOCKER_HUB_PASSWORD
- file:
credential-id: 93da78ec-7785-49ab-a1ef-586424b3e94f
variable: creds_config_file
- wrapper:
name: che_functional_tests_credentials_wrapper-periodical-prod-preview.openshift.io-free-stg
wrappers:
- credentials-binding:
- text:
credential-id: 1e0bbb30-cddd-4b6f-bc61-bb4ebd2706e5
variable: KEYCLOAK_TOKEN
- username-password-separated:
credential-id: ac51aeb0-a436-4a50-a71d-aa6f99075398
username: OSIO_USERNAME
password: OSIO_PASSWORD
- wrapper:
name: che_functional_tests_credentials_wrapper-prcheck-openshift.io-2
wrappers:
- credentials-binding:
- text:
credential-id: de793dce-5821-4182-af4f-6c7b42b5c21d
variable: KEYCLOAK_TOKEN
- username-password-separated:
credential-id: ac51aeb0-a436-4a50-a71d-aa6f99075398
username: OSIO_USERNAME
password: OSIO_PASSWORD
- wrapper:
name: che_functional_tests_credentials_wrapper-prcheck-prod-preview.openshift.io-2a
wrappers:
- credentials-binding:
- text:
credential-id: 60bf228a-e858-4ae3-94fb-7e73fa7d52d9
variable: KEYCLOAK_TOKEN
- username-password-separated:
credential-id: f9b7e98d-2ba0-40c3-8454-2475a064e216
username: OSIO_USERNAME
password: OSIO_PASSWORD
- job_template_defaults: &job_template_defaults
name: 'job_template_defaults'
description: |
{jobdescription}
node: "{ci_project}"
concurrent: true
beforeGetNode: ""
properties:
- github:
url: https://github.com/{git_organization}/{git_repo}/
- build-discarder:
days-to-keep: '{discarder_days}'
num-to-keep: '{discarder_num}'
scm:
- git-scm:
git_url: https://{github_user}@github.com/{git_organization}/{git_repo}.git
git_basedir: ''
triggers:
- githubprb:
github_hooks: '{github_hooks}'
builders:
- shell: |
# testing out the cico client
set +e
{beforeGetNode}
cp ~/artifacts.key .
export CICO_API_KEY=$(cat ~/duffy.key )
# get node
n=1
while true
do
cico_output=$(cico node get -f value -c ip_address -c comment)
if [ $? -eq 0 ]; then
read CICO_hostname CICO_ssid <<< $cico_output
if [ ! -z "$CICO_hostname" ]; then
# we got hostname from cico
break
fi
echo "'cico node get' succeed, but can't get hostname from output"
fi
if [ $n -gt 15 ]; then
# give up after 15 tries
echo "giving up on 'cico node get'"
exit 1
fi
echo "'cico node get' failed, trying again in 60s ($n/15)"
n=$[$n+1]
sleep 60
done
sshopts="-t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root"
ssh_cmd="ssh $sshopts $CICO_hostname"
cp ~/cico-tools/env-toolkit .
./env-toolkit dump -f jenkins-env.json
env > jenkins-env
$ssh_cmd yum -y install rsync
if [ -n "${{ghprbTargetBranch}}" ]; then
git rebase --preserve-merges origin/${{ghprbTargetBranch}}
rtn_code=$?
if [ $rtn_code -ne 0 ]; then
echo "The branch can not be rebased onto origin/${{ghprbTargetBranch}}."
exit $rtn_code
fi
else
echo "Not a PR build, using master"
fi
rsync -e "ssh $sshopts" -Ha $(pwd)/ $CICO_hostname:payload \
&& /usr/bin/timeout {timeout} $ssh_cmd -t "cd payload && {ci_cmd}"
rtn_code=$?
if [ $rtn_code -eq 0 ]; then
cico node done $CICO_ssid
else
if [[ $rtn_code -eq 124 ]]; then
echo "BUILD TIMEOUT";
cico node done $CICO_ssid
else
# fail mode gives us 12 hrs to debug the machine
curl "http://admin.ci.centos.org:8080/Node/fail?key=$CICO_API_KEY&ssid=$CICO_ssid"
fi
fi
exit $rtn_code
- job-template:
name: '{ci_project}-{git_repo}'
wrappers:
- ansicolor
- vault-secrets:
<<: *vault_defaults
secrets:
- *quay-credentials
- *registry-devshift-credentials
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-prcheck'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *quay-credentials
- *registry-devshift-credentials
- che_functional_tests_credentials_wrapper-periodical-prod-preview.openshift.io-free-stg
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-create-comment'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *quay-credentials
- *registry-devshift-credentials
- *fabric8-hub-token
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-prcheck-publish-artifacts'
publishers:
- archive:
artifacts: '{artifacts}'
allow-empty: '{allow_empty}'
fingerprint: '{fingerprint}'
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-jjb-test'
builders:
- shell: |
git rebase --preserve-merges origin/${{ghprbTargetBranch}}
{ci_cmd}
exit $?
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-coverage'
triggers:
- github-pull-request:
status-context: "ci.centos.org PR build (coverage)"
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-e2e'
triggers:
- github-pull-request:
status-context: "ci.centos.org PR build (e2e)"
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-wit-go-benchmarks'
triggers:
- timed: '59 23 * * 6'
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-analytics'
registry: 'MISSING_REGISTRY_NAME'
image_name: 'MISSING_IMAGE_NAME'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *quay-credentials
- *registry-devshift-credentials
- ansicolor
triggers:
- github-pull-request:
status-context: "ci.centos.org PR build (fabric8-analytics)"
org-list:
- fabric8-analytics
success-comment: "$ghprbPullAuthorLoginMention Your image is available in the registry: `docker pull {registry}/{image_name}:SNAPSHOT-PR-$ghprbPullId`"
<<: *github_pull_request_defaults
publishers:
- email:
recipients: [email protected]
notify-every-unstable-build: true
send-to-individuals: true
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-f8planner'
registry: 'MISSING_REGISTRY_NAME'
image_name: 'MISSING_IMAGE_NAME'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *fabric8-planner-test-token
- *quay-credentials
- *registry-devshift-credentials
- *fabric8-planner-test-preview-creds
- ansicolor
triggers:
- github-pull-request:
status-context: "ci.centos.org PR build (fabric8-planner)"
org-list:
- fabric8-ui
success-comment: "$ghprbPullAuthorLoginMention Your image is available in the registry. Run `docker pull {registry}/{image_name}:SNAPSHOT-PR-$ghprbPullId && docker run -it -p 5000:8080 {registry}/{image_name}:SNAPSHOT-PR-$ghprbPullId` and visit `http://localhost:5000` to access it."
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-analytics-copr-mercator'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *copr-mercator-api-token
- ansicolor
triggers:
- github-pull-request:
status-context: "ci.centos.org PR (copr) build (fabric8-analytics)"
org-list:
- fabric8-analytics
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-hdd'
image_name: 'MISSING_IMAGE_NAME'
registry: 'MISSING_REGISTRY_NAME'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *quay-credentials
- *registry-devshift-credentials
- ansicolor
triggers:
- github-pull-request:
status-context: "ci.centos.org PR build (fabric8-hdd)"
org-list:
- fabric8-hdd
success-comment: "$ghprbPullAuthorLoginMention Your image is available in the registry: `docker pull {registry}/{image_name}:SNAPSHOT-PR-$ghprbPullId`"
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-hdd-eslint'
wrappers:
- ansicolor
git_organization: fabric8-hdd
ci_project: 'devtools'
ci_cmd: '/bin/bash cico_run_eslint.sh'
timeout: '20m'
triggers:
- github-pull-request:
status-context: "ci.centos.org eslint run (fabric8-hdd)"
org-list:
- fabric8-hdd
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-analytics-pylint'
wrappers:
- ansicolor
git_organization: fabric8-analytics
ci_project: 'devtools'
ci_cmd: '/bin/bash cico_run_pylint.sh'
timeout: '20m'
triggers:
- github-pull-request:
status-context: "ci.centos.org pylint run (fabric8-analytics)"
org-list:
- fabric8-analytics
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template:
name: '{ci_project}-{git_repo}-fabric8-analytics-pydoc'
git_organization: fabric8-analytics
ci_project: 'devtools'
ci_cmd: '/bin/bash cico_run_pydoc.sh'
timeout: '20m'
triggers:
- github-pull-request:
status-context: "ci.centos.org check-style run (fabric8-analytics)"
org-list:
- fabric8-analytics
<<: *github_pull_request_defaults
<<: *job_template_defaults
- job-template: &job_template_build_defaults
name: 'job_template_build_defaults'
subdir: ''
description: |
{jobdescription}
node: "{ci_project}"
properties:
- github:
url: https://github.com/{git_organization}/{git_repo}/
scm:
- git:
url: https://github.com/{git_organization}/{git_repo}.git
shallow_clone: true
branches:
- '{branch}'
triggers:
- github
svc_name: none
prj_name: dsaas-preview
saas_git: none
saas_service_name: none
saasherder_prepare: |
if [ "$SAAS_GIT" != "none" ]; then
SAAS_ENV=staging
PATH=$PATH:~/.local/bin/
CONTEXT=$(echo $SAAS_GIT | sed 's/.*://')
SAAS_GIT=$(echo $SAAS_GIT | sed 's/:.*//')
SAASHERDER_OBJECT_WHITELIST=Deployment,DeploymentConfig,Service,ConfigMap,Role,RoleBinding,ServiceAccount,CronJob
if [[ -z "$SAAS_SERVICE_NAME" || "$SAAS_SERVICE_NAME" == "none" ]]; then
SAAS_SERVICE_NAME=$GIT_REPO
fi
if [ "$SUBDIR" != "" ]; then
SAAS_SERVICE_NAME=$SAAS_SERVICE_NAME"-"$SUBDIR
fi
git clone --depth 1 https://github.com/openshiftio/$SAAS_GIT saas.git
cd saas.git
[ "$CONTEXT" != "$SAAS_GIT" ] && saasherder --context $CONTEXT config get-contexts > /dev/null
export DEVSHIFT_TAG_LEN=$(saasherder --environment $SAAS_ENV get hash_length $SAAS_SERVICE_NAME)
cd ..
fi
saasherder_deploy: |
if [ "$SVC_NAME" != "none" ]; then
oc --server="$KUBE_SERVER" --token="$KUBE_TOKEN" rollout latest $SVC_NAME -n $PRJ_NAME
rtn_code=$?
fi
if [ "$SAAS_GIT" != "none" ]; then
cd saas.git
saasherder --environment $SAAS_ENV update hash $SAAS_SERVICE_NAME $GIT_COMMIT
saasherder --environment $SAAS_ENV pull $SAAS_SERVICE_NAME
saasherder --environment $SAAS_ENV template --filter Route --output-dir $GIT_REPO-processed tag $SAAS_SERVICE_NAME
saasherder --environment $SAAS_ENV label --output-dir $GIT_REPO-processed --saas-repo-url $SAAS_GIT $SAAS_SERVICE_NAME > label_selector
oc --server="$KUBE_SERVER" --token="$KUBE_TOKEN" apply -f $GIT_REPO-processed/$SAAS_SERVICE_NAME.yaml -n $PRJ_NAME
rtn_code=$?
if [ $rtn_code -ne 0 ]; then
echo "error during oc apply"
exit $rtn_code
fi
label_selector=$(cat label_selector)
resources_to_delete=$(oc --server="$KUBE_SERVER" --token="$KUBE_TOKEN" get $SAASHERDER_OBJECT_WHITELIST -o name -l "$label_selector" -n $PRJ_NAME)
for r in $resources_to_delete; do
oc --server="$KUBE_SERVER" --token="$KUBE_TOKEN" -n $PRJ_NAME delete $r
done
cd ..
fi
extra_target: ""
builders:
- shell: |
# testing out the cico client
set +e
export CICO_API_KEY=$(cat ~/duffy.key )
get_cico_node() {{
# get node
n=1
while true
do
cico_output=$(cico node get -f value -c ip_address -c comment)
if [ $? -eq 0 ]; then
read CICO_hostname CICO_ssid <<< $cico_output
if [ ! -z "$CICO_hostname" ]; then
# we got hostname from cico
break
fi
echo "'cico node get' succeed, but can't get hostname from output" >&2
fi
if [ $n -gt 15 ]; then
# give up after 15 tries
echo "giving up on 'cico node get'" >&2
return 1
fi
echo "'cico node get' failed, trying again in 60s ($n/15)" >&2
n=$[$n+1]
sleep 60
done
echo "$CICO_hostname" "$CICO_ssid"
}}
# Verify Job configuration
if [ "{svc_name}" == "none" -a "{saas_git}" == "none" ]; then
echo "Not part of SAAS"
else
#Prepare values for deployment
SVC_NAME={svc_name}
SUBDIR="{subdir}"
GIT_REPO={git_repo}
PRJ_NAME={prj_name}
SAAS_GIT={saas_git}
{saasherder_prepare}
fi
if [ -z "$DEVSHIFT_TAG_LEN" ]; then
export DEVSHIFT_TAG_LEN=7
fi
sshopts="-t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root"
cp ~/cico-tools/env-toolkit .
./env-toolkit dump -f jenkins-env.json
env > jenkins-env
# CentOS build
cico_node_output=$(get_cico_node)
[ "$?" != "0" ] && exit 1
read CICO_hostname CICO_ssid <<< $cico_node_output
ssh_cmd="ssh $sshopts $CICO_hostname"
$ssh_cmd yum -y install rsync
rsync -e "ssh $sshopts" -Ha $(pwd)/ $CICO_hostname:payload
$ssh_cmd -t "cd payload && {ci_cmd}"
rtn_code=$?
if [ "$rtn_code" != "0" ]; then
curl "http://admin.ci.centos.org:8080/Node/fail?key=$CICO_API_KEY&ssid=$CICO_ssid"
exit $rtn_code
fi
# RHEL build
if [ -n "{extra_target}" ]; then
$ssh_cmd -t "cd payload && TARGET=\"{extra_target}\" {ci_cmd}"
rtn_code=$?
if [ "$rtn_code" != "0" ]; then
curl "http://admin.ci.centos.org:8080/Node/fail?key=$CICO_API_KEY&ssid=$CICO_ssid"
exit $rtn_code
fi
fi
#Deploy preview
# Verify Job configuration
if [ "{svc_name}" == "none" -a "{saas_git}" == "none" ]; then
echo "Not part of SAAS, skipping deployment"
else
{saasherder_deploy}
fi
exit $rtn_code
- job-template:
name: '{ci_project}-{git_repo}-fabric8-analytics-build-master'
wrappers:
- vault-secrets:
<<: *vault_defaults
secrets:
- *kube-config-dsaas-stg
- *quay-credentials
- *registry-devshift-credentials
scm:
- git:
url: https://github.com/{git_organization}/{git_repo}.git
shallow_clone: true
branches:
- '{build_branch}'
saasherder_prepare: |
set -x
if [ "$SAAS_GIT" != "none" ]; then
SAAS_ENV=staging
PATH=$PATH:~/.local/bin/
CONTEXT=$(echo $SAAS_GIT | sed 's/.*://')
SAAS_GIT=$(echo $SAAS_GIT | sed 's/:.*//')
SAAS_SERVICE_NAMES=$SVC_NAME
git clone --depth 1 https://github.com/openshiftio/$SAAS_GIT saas.git
cd saas.git
[ "$CONTEXT" != "$SAAS_GIT" ] && saasherder --context $CONTEXT config get-contexts > /dev/null
cd ..
fi
set +x
saasherder_deploy: |
if [ "$SAAS_GIT" != "none" ]; then
cd saas.git
for SAAS_SERVICE_NAME in $SAAS_SERVICE_NAMES; do
export DEVSHIFT_TAG_LEN=$(saasherder --environment $SAAS_ENV get hash_length $SAAS_SERVICE_NAME)