forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
4217 lines (4216 loc) · 110 KB
/
.drone.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
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
---
depends_on: []
kind: pipeline
name: pr-test
node:
type: no-parallel
platform:
arch: amd64
os: linux
services: []
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.15
name: identify-runner
- commands:
- make gen-go
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
- yarn install --immutable
image: grafana/build-container:1.4.9
name: initialize
- commands:
- ./bin/grabpl verify-drone
depends_on:
- grabpl
image: byrnedo/alpine-curl:0.1.8
name: lint-drone
- commands:
- |-
echo -e "unknwon
referer
errorstring
eror
iam
wan" > words_to_ignore.txt
- codespell -I words_to_ignore.txt docs/
- rm words_to_ignore.txt
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: codespell
- commands:
- ./bin/grabpl shellcheck
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: shellcheck
- commands:
- ./bin/grabpl lint-backend --edition oss
depends_on:
- initialize
environment:
CGO_ENABLED: "1"
image: grafana/build-container:1.4.9
name: lint-backend
- commands:
- yarn run prettier:check
- yarn run lint
- yarn run i18n:compile
- yarn run typecheck
depends_on:
- initialize
environment:
TEST_MAX_WORKERS: 50%
image: grafana/build-container:1.4.9
name: lint-frontend
- commands:
- ./bin/grabpl test-backend --edition oss
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: test-backend
- commands:
- ./bin/grabpl integration-tests --edition oss
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: test-backend-integration
- commands:
- yarn run ci:test-frontend
depends_on:
- initialize
environment:
TEST_MAX_WORKERS: 50%
image: grafana/build-container:1.4.9
name: test-frontend
trigger:
event:
- pull_request
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
---
depends_on: []
kind: pipeline
name: pr-build-e2e
node:
type: no-parallel
platform:
arch: amd64
os: linux
services: []
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.15
name: identify-runner
- commands:
- make gen-go
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
- yarn install --immutable
image: grafana/build-container:1.4.9
name: initialize
- commands:
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
--variants linux-x64,linux-x64-musl,osx64,win64,armv6 --no-pull-enterprise
depends_on:
- initialize
environment: {}
image: grafana/build-container:1.4.9
name: build-backend
- commands:
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id
${DRONE_BUILD_NUMBER} --no-pull-enterprise
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.4.9
name: build-frontend
- commands:
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
depends_on:
- initialize
environment: null
image: grafana/build-container:1.4.9
name: build-plugins
- commands:
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
depends_on:
- build-backend
image: grafana/build-container:1.4.9
name: validate-scuemata
- commands:
- '# Make sure the git tree is clean.'
- '# Stashing changes, since packages that were produced in build-backend step are
needed.'
- git stash
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
.cue files.'
- '# It is required that the generated Typescript be in sync with the input CUE
files.'
- '# ...Modulo eslint auto-fixes...:'
- yarn run eslint . --ext .gen.ts --fix
- '# If any filenames are emitted by the below script, run the generator command
`grafana-cli cue gen-ts` locally and commit the result.'
- ./scripts/clean-git-or-error.sh
- '# Un-stash changes.'
- git stash pop
depends_on:
- validate-scuemata
image: grafana/build-container:1.4.9
name: ensure-cuetsified
- commands:
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss
--build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64,armv6
depends_on:
- build-plugins
- build-backend
- build-frontend
environment: null
image: grafana/build-container:1.4.9
name: package
- commands:
- ./scripts/grafana-server/start-server
depends_on:
- build-plugins
- build-backend
- build-frontend
detach: true
environment:
ARCH: linux-amd64
PORT: 3001
image: grafana/build-container:1.4.9
name: grafana-server
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite dashboards-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-dashboards-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite smoke-tests-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-smoke-tests-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite panels-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-panels-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite various-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-various-suite
- commands:
- apt-get update
- apt-get install -yq zip
- ls -lah ./e2e
- find ./e2e -type f -name "*.mp4"
- printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json
- find ./e2e -type f -name "*spec.ts.mp4" | zip e2e/videos.zip -@
- gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip
- export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip
- 'echo "E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}"'
- 'curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA}
-H "Authorization: token $${GITHUB_TOKEN}" -d "{\"state\":\"success\",\"target_url\":\"$${E2E_ARTIFACTS_VIDEO_ZIP}\",
\"description\": \"Click on the details to download e2e recording videos\", \"context\":
\"e2e_artifacts\"}"'
depends_on:
- end-to-end-tests-dashboards-suite
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
environment:
E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev
GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY:
from_secret: gcp_upload_artifacts_key
GITHUB_TOKEN:
from_secret: github_token
image: google/cloud-sdk:367.0.0
name: e2e-tests-artifacts-upload
when:
status:
- success
- failure
- commands:
- yarn storybook:build
- ./bin/grabpl verify-storybook
depends_on:
- build-frontend
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: grafana/build-container:1.4.9
name: build-storybook
- commands:
- yarn wait-on http://$HOST:$PORT
- pa11y-ci --config .pa11yci-pr.conf.js
depends_on:
- grafana-server
environment:
GRAFANA_MISC_STATS_API_KEY:
from_secret: grafana_misc_stats_api_key
HOST: grafana-server
PORT: 3001
failure: always
image: grafana/docker-puppeteer:1.0.0
name: test-a11y-frontend
- commands:
- ./scripts/ci-reference-docs-lint.sh ci
depends_on:
- build-frontend
image: grafana/build-container:1.4.9
name: build-frontend-docs
- commands:
- mkdir -p /hugo/content/docs/grafana
- cp -r docs/sources/* /hugo/content/docs/grafana/latest/
- cd /hugo && make prod
depends_on:
- build-frontend-docs
image: grafana/docs-base:latest
name: build-docs-website
- commands:
- ls dist/*.tar.gz*
- cp dist/*.tar.gz* packaging/docker/
depends_on:
- package
image: grafana/build-container:1.4.9
name: copy-packages-for-docker
- commands:
- ./bin/grabpl build-docker --edition oss -archs amd64
depends_on:
- copy-packages-for-docker
environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images
volumes:
- name: docker
path: /var/run/docker.sock
trigger:
event:
- pull_request
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
---
depends_on: []
kind: pipeline
name: pr-integration-tests
node:
type: no-parallel
platform:
arch: amd64
os: linux
services:
- environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: grafanatest
POSTGRES_PASSWORD: grafanatest
POSTGRES_USER: grafanatest
image: postgres:12.3-alpine
name: postgres
volumes:
- name: postgres
path: /var/lib/postgresql/data/pgdata
- environment:
MYSQL_DATABASE: grafana_tests
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana
image: mysql:5.6.48
name: mysql
volumes:
- name: mysql
path: /var/lib/mysql
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- apt-get update
- apt-get install -yq postgresql-client
- dockerize -wait tcp://postgres:5432 -timeout 120s
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
- go clean -testcache
- ./bin/grabpl integration-tests --database postgres
depends_on:
- grabpl
environment:
GRAFANA_TEST_DB: postgres
PGPASSWORD: grafanatest
POSTGRES_HOST: postgres
image: grafana/build-container:1.4.9
name: postgres-integration-tests
- commands:
- apt-get update
- apt-get install -yq default-mysql-client
- dockerize -wait tcp://mysql:3306 -timeout 120s
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
-prootpass
- go clean -testcache
- ./bin/grabpl integration-tests --database mysql
depends_on:
- grabpl
environment:
GRAFANA_TEST_DB: mysql
MYSQL_HOST: mysql
image: grafana/build-container:1.4.9
name: mysql-integration-tests
trigger:
event:
- pull_request
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
- name: postgres
temp:
medium: memory
- name: mysql
temp:
medium: memory
---
depends_on: []
kind: pipeline
name: main-test
node:
type: no-parallel
platform:
arch: amd64
os: linux
services: []
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.15
name: identify-runner
- commands:
- make gen-go
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
- yarn install --immutable
image: grafana/build-container:1.4.9
name: initialize
- commands:
- ./bin/grabpl verify-drone
depends_on:
- grabpl
image: byrnedo/alpine-curl:0.1.8
name: lint-drone
- commands:
- |-
echo -e "unknwon
referer
errorstring
eror
iam
wan" > words_to_ignore.txt
- codespell -I words_to_ignore.txt docs/
- rm words_to_ignore.txt
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: codespell
- commands:
- ./bin/grabpl shellcheck
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: shellcheck
- commands:
- ./bin/grabpl lint-backend --edition oss
depends_on:
- initialize
environment:
CGO_ENABLED: "1"
image: grafana/build-container:1.4.9
name: lint-backend
- commands:
- yarn run prettier:check
- yarn run lint
- yarn run i18n:compile
- yarn run typecheck
depends_on:
- initialize
environment:
TEST_MAX_WORKERS: 50%
image: grafana/build-container:1.4.9
name: lint-frontend
- commands:
- ./bin/grabpl test-backend --edition oss
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: test-backend
- commands:
- ./bin/grabpl integration-tests --edition oss
depends_on:
- initialize
image: grafana/build-container:1.4.9
name: test-backend-integration
- commands:
- yarn run ci:test-frontend
depends_on:
- initialize
environment:
TEST_MAX_WORKERS: 50%
image: grafana/build-container:1.4.9
name: test-frontend
trigger:
branch: main
event:
- push
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
---
depends_on: []
kind: pipeline
name: main-build-e2e-publish
node:
type: no-parallel
platform:
arch: amd64
os: linux
services: []
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- echo $DRONE_RUNNER_NAME
image: alpine:3.15
name: identify-runner
- commands:
- make gen-go
- ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER}
- yarn install --immutable
image: grafana/build-container:1.4.9
name: initialize
- image: grafana/drone-downstream
name: trigger-enterprise-downstream
settings:
params:
- SOURCE_BUILD_NUMBER=${DRONE_BUILD_NUMBER}
- SOURCE_COMMIT=${DRONE_COMMIT}
repositories:
- grafana/grafana-enterprise@main
server: https://drone.grafana.net
token:
from_secret: drone_token
- commands:
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
--no-pull-enterprise
depends_on:
- initialize
environment: {}
image: grafana/build-container:1.4.9
name: build-backend
- commands:
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id
${DRONE_BUILD_NUMBER} --no-pull-enterprise
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.4.9
name: build-frontend
- commands:
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin
depends_on:
- initialize
environment:
GRAFANA_API_KEY:
from_secret: grafana_api_key
image: grafana/build-container:1.4.9
name: build-plugins
- commands:
- ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root .
depends_on:
- build-backend
image: grafana/build-container:1.4.9
name: validate-scuemata
- commands:
- '# Make sure the git tree is clean.'
- '# Stashing changes, since packages that were produced in build-backend step are
needed.'
- git stash
- ./bin/linux-amd64/grafana-cli cue gen-ts --grafana-root .
- '# The above command generates Typescript files (*.gen.ts) from all appropriate
.cue files.'
- '# It is required that the generated Typescript be in sync with the input CUE
files.'
- '# ...Modulo eslint auto-fixes...:'
- yarn run eslint . --ext .gen.ts --fix
- '# If any filenames are emitted by the below script, run the generator command
`grafana-cli cue gen-ts` locally and commit the result.'
- ./scripts/clean-git-or-error.sh
- '# Un-stash changes.'
- git stash pop
depends_on:
- validate-scuemata
image: grafana/build-container:1.4.9
name: ensure-cuetsified
- commands:
- ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise
--sign
depends_on:
- build-plugins
- build-backend
- build-frontend
environment:
GITHUB_TOKEN:
from_secret: github_token
GPG_KEY_PASSWORD:
from_secret: gpg_key_password
GPG_PRIV_KEY:
from_secret: gpg_priv_key
GPG_PUB_KEY:
from_secret: gpg_pub_key
GRAFANA_API_KEY:
from_secret: grafana_api_key
image: grafana/build-container:1.4.9
name: package
- commands:
- ./scripts/grafana-server/start-server
depends_on:
- build-plugins
- build-backend
- build-frontend
detach: true
environment:
ARCH: linux-amd64
PORT: 3001
image: grafana/build-container:1.4.9
name: grafana-server
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite dashboards-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-dashboards-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite smoke-tests-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-smoke-tests-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite panels-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-panels-suite
- commands:
- apt-get install -y netcat
- ./bin/grabpl e2e-tests --port 3001 --suite various-suite
depends_on:
- grafana-server
environment:
HOST: grafana-server
image: cypress/included:9.3.1
name: end-to-end-tests-various-suite
- commands:
- apt-get update
- apt-get install -yq zip
- ls -lah ./e2e
- find ./e2e -type f -name "*.mp4"
- printenv GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY > /tmp/gcpkey_upload_artifacts.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey_upload_artifacts.json
- find ./e2e -type f -name "*spec.ts.mp4" | zip e2e/videos.zip -@
- gsutil cp e2e/videos.zip gs://$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip
- export E2E_ARTIFACTS_VIDEO_ZIP=https://storage.googleapis.com/$${E2E_TEST_ARTIFACTS_BUCKET}/${DRONE_BUILD_NUMBER}/artifacts/videos/videos.zip
- 'echo "E2E Test artifacts uploaded to: $${E2E_ARTIFACTS_VIDEO_ZIP}"'
- 'curl -X POST https://api.github.com/repos/${DRONE_REPO}/statuses/${DRONE_COMMIT_SHA}
-H "Authorization: token $${GITHUB_TOKEN}" -d "{\"state\":\"success\",\"target_url\":\"$${E2E_ARTIFACTS_VIDEO_ZIP}\",
\"description\": \"Click on the details to download e2e recording videos\", \"context\":
\"e2e_artifacts\"}"'
depends_on:
- end-to-end-tests-dashboards-suite
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
environment:
E2E_TEST_ARTIFACTS_BUCKET: releng-pipeline-artifacts-dev
GCP_GRAFANA_UPLOAD_ARTIFACTS_KEY:
from_secret: gcp_upload_artifacts_key
GITHUB_TOKEN:
from_secret: github_token
image: google/cloud-sdk:367.0.0
name: e2e-tests-artifacts-upload
when:
status:
- success
- failure
- commands:
- yarn storybook:build
- ./bin/grabpl verify-storybook
depends_on:
- build-frontend
environment:
NODE_OPTIONS: --max_old_space_size=4096
image: grafana/build-container:1.4.9
name: build-storybook
- commands:
- printenv GCP_KEY | base64 -d > /tmp/gcpkey.json
- gcloud auth activate-service-account --key-file=/tmp/gcpkey.json
- gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://$${PRERELEASE_BUCKET}/artifacts/storybook/canary
depends_on:
- build-storybook
- end-to-end-tests-dashboards-suite
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
environment:
GCP_KEY:
from_secret: gcp_key
PRERELEASE_BUCKET:
from_secret: prerelease_bucket
image: grafana/grafana-ci-deploy:1.3.1
name: store-storybook
- commands:
- yarn wait-on http://$HOST:$PORT
- pa11y-ci --config .pa11yci.conf.js --json > pa11y-ci-results.json
depends_on:
- grafana-server
environment:
GRAFANA_MISC_STATS_API_KEY:
from_secret: grafana_misc_stats_api_key
HOST: grafana-server
PORT: 3001
failure: ignore
image: grafana/docker-puppeteer:1.0.0
name: test-a11y-frontend
- commands:
- ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY}
depends_on:
- test-a11y-frontend
environment:
GRAFANA_MISC_STATS_API_KEY:
from_secret: grafana_misc_stats_api_key
failure: ignore
image: grafana/build-container:1.4.9
name: publish-frontend-metrics
- commands:
- ./scripts/ci-reference-docs-lint.sh ci
depends_on:
- build-frontend
image: grafana/build-container:1.4.9
name: build-frontend-docs
- commands:
- ls dist/*.tar.gz*
- cp dist/*.tar.gz* packaging/docker/
depends_on:
- package
image: grafana/build-container:1.4.9
name: copy-packages-for-docker
- commands:
- ./bin/grabpl build-docker --edition oss
depends_on:
- copy-packages-for-docker
environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./bin/grabpl build-docker --edition oss --ubuntu
depends_on:
- copy-packages-for-docker
environment:
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: build-docker-images-ubuntu
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana --base alpine --base
ubuntu --arch amd64 --arch arm64 --arch armv7
depends_on:
- build-docker-images
- build-docker-images-ubuntu
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: publish-images-grafana
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana-oss --base alpine
--base ubuntu --arch amd64 --arch arm64 --arch armv7
depends_on:
- build-docker-images
- build-docker-images-ubuntu
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
GCP_KEY:
from_secret: gcp_key
image: google/cloud-sdk
name: publish-images-grafana-oss
volumes:
- name: docker
path: /var/run/docker.sock
- commands:
- ./scripts/circle-release-canary-packages.sh
depends_on:
- end-to-end-tests-dashboards-suite
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
environment:
NPM_TOKEN:
from_secret: npm_token
image: grafana/build-container:1.4.9
name: release-canary-npm-packages
- commands:
- ./bin/grabpl upload-packages --edition oss --packages-bucket grafana-downloads
depends_on:
- end-to-end-tests-dashboards-suite
- end-to-end-tests-panels-suite
- end-to-end-tests-smoke-tests-suite
- end-to-end-tests-various-suite
environment:
GCP_KEY:
from_secret: gcp_key
PRERELEASE_BUCKET:
from_secret: prerelease_bucket
image: grafana/grafana-ci-deploy:1.3.1
name: upload-packages
- commands:
- ./bin/grabpl upload-cdn --edition oss --src-bucket "grafana-static-assets"
depends_on:
- grafana-server
environment:
GCP_KEY:
from_secret: gcp_key
PRERELEASE_BUCKET:
from_secret: prerelease_bucket
image: grafana/grafana-ci-deploy:1.3.1
name: upload-cdn-assets
trigger:
branch: main
event:
- push
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
- name: postgres
temp:
medium: memory
- name: mysql
temp:
medium: memory
---
depends_on: []
kind: pipeline
name: main-integration-tests
node:
type: no-parallel
platform:
arch: amd64
os: linux
services:
- environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: grafanatest
POSTGRES_PASSWORD: grafanatest
POSTGRES_USER: grafanatest
image: postgres:12.3-alpine
name: postgres
volumes:
- name: postgres
path: /var/lib/postgresql/data/pgdata
- environment:
MYSQL_DATABASE: grafana_tests
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_USER: grafana
image: mysql:5.6.48
name: mysql
volumes:
- name: mysql
path: /var/lib/mysql
steps:
- commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/grabpl
- chmod +x bin/grabpl
image: byrnedo/alpine-curl:0.1.8
name: grabpl
- commands:
- apt-get update
- apt-get install -yq postgresql-client
- dockerize -wait tcp://postgres:5432 -timeout 120s
- psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql
- go clean -testcache
- ./bin/grabpl integration-tests --database postgres
depends_on:
- grabpl
environment:
GRAFANA_TEST_DB: postgres
PGPASSWORD: grafanatest
POSTGRES_HOST: postgres
image: grafana/build-container:1.4.9
name: postgres-integration-tests
- commands:
- apt-get update
- apt-get install -yq default-mysql-client
- dockerize -wait tcp://mysql:3306 -timeout 120s
- cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root
-prootpass
- go clean -testcache
- ./bin/grabpl integration-tests --database mysql
depends_on:
- grabpl
environment:
GRAFANA_TEST_DB: mysql
MYSQL_HOST: mysql
image: grafana/build-container:1.4.9
name: mysql-integration-tests
trigger:
branch: main
event:
- push
type: docker
volumes:
- host:
path: /var/run/docker.sock
name: docker
- name: postgres
temp:
medium: memory
- name: mysql
temp:
medium: memory
---
depends_on:
- main-test
- main-build-e2e-publish
- main-integration-tests
kind: pipeline
name: windows-main
platform:
arch: amd64
os: windows
version: "1809"
services: []
steps:
- commands:
- echo $env:DRONE_RUNNER_NAME
image: mcr.microsoft.com/windows:1809
name: identify-runner
- commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.8.9/windows/grabpl.exe
-OutFile grabpl.exe
image: grafana/ci-wix:0.1.1
name: initialize
- commands:
- $$gcpKey = $$env:GCP_KEY
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
> gcpkey.json'
- dos2unix gcpkey.json
- gcloud auth activate-service-account --key-file=gcpkey.json
- rm gcpkey.json
- cp C:\App\nssm-2.24.zip .
- .\grabpl.exe gen-version --build-id $$env:DRONE_BUILD_NUMBER
- .\grabpl.exe windows-installer --edition oss --packages-bucket grafana-downloads
--build-id $$env:DRONE_BUILD_NUMBER
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
- gsutil cp $$fname gs://grafana-downloads/oss/main/
- gsutil cp "$$fname.sha256" gs://grafana-downloads/oss/main/
depends_on:
- initialize
environment: