forked from iExecBlockchainComputing/web3mail-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
1787 lines (1617 loc) · 44 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
# sdk @iexec/web3mail default pipeline
kind: pipeline
type: docker
name: sdk-default
trigger:
event: push
steps:
##### START LOCAL STACK #####
- name: prepare-local-stack-env
image: node
commands:
- node tests/prepare-test-env.js
- name: bellecour-fork
detach: true
image: ghcr.io/foundry-rs/foundry:latest
pull: always
expose:
- 8545
commands:
- anvil --host 0.0.0.0 --port 8545 --block-time 1 --hardfork berlin --fork-url $(cat local-stack-env/BELLECOUR_FORK_URL) --fork-block-number $(cat local-stack-env/BELLECOUR_FORK_BLOCK) --chain-id 134 --gas-limit 6700000 --gas-price 0
depends_on:
- prepare-local-stack-env
- name: bellecour-fork-healthy
image: bash
commands:
- while ! nc -z bellecour-fork 8545 ; do sleep 1 ; done && echo "bellecour-fork ready"
depends_on:
- bellecour-fork
- name: ipfs
image: ipfs/go-ipfs:v0.9.1
detach: true
expose:
- 8080
- 5001
- name: ipfs-healthy
image: bash
commands:
- while ! nc -z ipfs 8080 ; do sleep 1 ; done && echo "ipfs gateway ready"
- while ! nc -z ipfs 5001 ; do sleep 1 ; done && echo "ipfs upload ready"
depends_on:
- ipfs
- name: market-mongo
image: mongo:6.0.3
detach: true
expose:
- 27017
- name: market-mongo-healthy
image: bash
commands:
- while ! nc -z market-mongo 27017 ; do sleep 1 ; done && echo "market-mongo ready"
depends_on:
- market-mongo
- name: market-redis
image: redis:7.0.7-alpine
detach: true
commands:
- redis-server --appendonly yes
expose:
- 6379
- name: market-redis-healthy
image: bash
commands:
- while ! nc -z market-redis 6379 ; do sleep 1 ; done && echo "market-redis ready"
depends_on:
- market-redis
- name: result-proxy-mongo
image: library/mongo:4.2
detach: true
commands:
- mongod --bind_ip_all --port 13202
expose:
- 13202
- name: result-proxy-mongo-healthy
image: bash
commands:
- while ! nc -z result-proxy-mongo 13202 ; do sleep 1 ; done && echo "result-proxy-mongo ready"
depends_on:
- result-proxy-mongo
- name: graphnode-postgres
image: postgres:12
detach: true
commands:
- docker-entrypoint.sh postgres -cshared_preload_libraries=pg_stat_statements
expose:
- 5432
environment:
POSTGRES_USER: graphnode
POSTGRES_PASSWORD: password
POSTGRES_DB: graphnode-db
- name: graphnode-postgres-healthy
image: bash
commands:
- while ! nc -z graphnode-postgres 5432 ; do sleep 1 ; done && echo "graphnode-postgres ready"
depends_on:
- graphnode-postgres
- name: graphnode
image: graphprotocol/graph-node:v0.27.0
detach: true
expose:
- 8000
- 8020
environment:
postgres_host: graphnode-postgres
postgres_port: 5432
postgres_user: graphnode
postgres_pass: password
postgres_db: graphnode-db
ipfs: ipfs:5001
ethereum: bellecour:http://bellecour-fork:8545
commands:
- export GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- ipfs-healthy
- graphnode-postgres-healthy
- name: graphnode-healthy
image: bash
commands:
- while ! nc -z graphnode 8020 ; do sleep 1 ; done && echo "graphnode admin ready"
- while ! nc -z graphnode 8000 ; do sleep 1 ; done && echo "graphnode gql ready"
depends_on:
- graphnode
- name: sms
image: iexechub/iexec-sms:7.1.0
detach: true
environment:
TZ: Europe/Paris
IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
IEXEC_TEE_WORKER_PRE_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-pre-compute:7.1.0-sconify-5.3.15-debug
IEXEC_TEE_WORKER_PRE_COMPUTE_FINGERPRINT: 9f0f782d6edc611baa23ca0978f555ee58ea70e092640c961e75c25e9e4b0f22
IEXEC_TEE_WORKER_PRE_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_TEE_WORKER_POST_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-post-compute:7.1.1-sconify-5.3.15-debug
IEXEC_TEE_WORKER_POST_COMPUTE_FINGERPRINT: face1376b97131e2dc75a556381d47a2e03bed9e1bc11e462471f99d1eefae50
IEXEC_TEE_WORKER_POST_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_IGNORED_SGX_ADVISORIES: INTEL-SA-00161,INTEL-SA-00289,INTEL-SA-00334,INTEL-SA-00381,INTEL-SA-00389,INTEL-SA-00220,INTEL-SA-00270,INTEL-SA-00293,INTEL-SA-00320,INTEL-SA-00329,INTEL-SA-00477
IEXEC_SCONE_TOLERATED_INSECURE_OPTIONS: debug-mode,hyperthreading,outdated-tcb
IEXEC_SMS_DISPLAY_DEBUG_SESSION: 'true'
IEXEC_SCONE_CAS_HOST: foo
IEXEC_SMS_IMAGE_LAS_IMAGE: foo
expose:
- 13300
depends_on:
- bellecour-fork-healthy
- name: sms-healthy
image: bash
commands:
- while ! nc -z sms 13300 ; do sleep 1 ; done && echo "sms ready"
depends_on:
- sms
- name: result-proxy
image: iexechub/iexec-result-proxy:7.1.0
detach: true
environment:
IEXEC_PRIVATE_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_PUBLIC_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: result-proxy-mongo
MONGO_PORT: 13202
IEXEC_IPFS_HOST: ipfs
expose:
- 13200
depends_on:
- bellecour-fork-healthy
- ipfs-healthy
- result-proxy-mongo-healthy
- name: result-proxy-healthy
image: bash
commands:
- while ! nc -z result-proxy 13200 ; do sleep 1 ; done && echo "result-proxy ready"
depends_on:
- result-proxy
- name: market-watcher
image: iexechub/iexec-market-watcher:6.4
detach: true
environment:
CHAIN: BELLECOUR
ETH_WS_HOST: ws://bellecour-fork:8545
ETH_RPC_HOST: http://bellecour-fork:8545
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
commands:
- export START_BLOCK=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cd /app
- npm start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api
image: iexechub/iexec-market-api:6.4
detach: true
expose:
- 3000
environment:
CHAINS: BELLECOUR_FORK
BELLECOUR_FORK_ETH_RPC_HOST: http://bellecour-fork:8545
BELLECOUR_FORK_CHAIN_ID: 134
BELLECOUR_FORK_IS_NATIVE: 'true'
BELLECOUR_FORK_IEXEC_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
RATE_LIMIT_MAX: 10000
RATE_LIMIT_PERIOD: 60000
MAX_OPEN_ORDERS_PER_WALLET: 1000
depends_on:
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api-healthy
image: bash
commands:
- while ! nc -z market-api 3000 ; do sleep 1 ; done && echo "market-api ready"
depends_on:
- market-api
- market-watcher
- name: subgraph-deploy
image: node:18.19
environment:
START_BLOCK: $BELLECOUR_FORK_BLOCK
GRAPHNODE_URL: http://graphnode:8020
IPFS_URL: http://ipfs:5001
commands:
- git clone --single-branch -b main https://github.com/iExecBlockchainComputing/dataprotector-sdk.git
- rm -rf dataprotector-subgraph && cp -r dataprotector-sdk/packages/subgraph dataprotector-subgraph
- rm -rf dataprotector-sdk && cd dataprotector-subgraph
- npm ci
- export START_BLOCK=$(cat ../local-stack-env/BELLECOUR_FORK_BLOCK)
- npm run all
depends_on:
- prepare-local-stack-env
- ipfs-healthy
- graphnode-healthy
- name: stack-ready
image: bash
commands:
- echo "all services ready"
depends_on:
- bellecour-fork-healthy
- sms-healthy
- result-proxy-healthy
- market-api-healthy
- ipfs-healthy
- graphnode-healthy
- subgraph-deploy
##### START LOCAL STACK END #####
- name: install
image: node:18.19
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- install
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- install
- name: check-types
image: node:18.19
commands:
- npm run check-types
depends_on:
- install
- name: test
image: node:18.19
commands:
- npm run test
depends_on:
- install
- stack-ready
- name: build
image: node:18.19
commands:
- npm run build
depends_on:
- install
- name: npm-publish-dry-run
image: node:18.19
commands:
- npm publish --dry-run
depends_on:
- format
- lint
- check-types
- test
- build
---
# sdk @iexec/web3mail publish npm nightly pipeline
kind: pipeline
type: docker
name: sdk-publish-nightly
trigger:
event:
- promote
target:
- sdk-nightly
branch:
- develop
steps:
##### START LOCAL STACK #####
- name: prepare-local-stack-env
image: node
commands:
- node tests/prepare-test-env.js
- name: bellecour-fork
detach: true
image: ghcr.io/foundry-rs/foundry:latest
pull: always
expose:
- 8545
commands:
- anvil --host 0.0.0.0 --port 8545 --block-time 1 --hardfork berlin --fork-url $(cat local-stack-env/BELLECOUR_FORK_URL) --fork-block-number $(cat local-stack-env/BELLECOUR_FORK_BLOCK) --chain-id 134 --gas-limit 6700000 --gas-price 0
depends_on:
- prepare-local-stack-env
- name: bellecour-fork-healthy
image: bash
commands:
- while ! nc -z bellecour-fork 8545 ; do sleep 1 ; done && echo "bellecour-fork ready"
depends_on:
- bellecour-fork
- name: ipfs
image: ipfs/go-ipfs:v0.9.1
detach: true
expose:
- 8080
- 5001
- name: ipfs-healthy
image: bash
commands:
- while ! nc -z ipfs 8080 ; do sleep 1 ; done && echo "ipfs gateway ready"
- while ! nc -z ipfs 5001 ; do sleep 1 ; done && echo "ipfs upload ready"
depends_on:
- ipfs
- name: market-mongo
image: mongo:6.0.3
detach: true
expose:
- 27017
- name: market-mongo-healthy
image: bash
commands:
- while ! nc -z market-mongo 27017 ; do sleep 1 ; done && echo "market-mongo ready"
depends_on:
- market-mongo
- name: market-redis
image: redis:7.0.7-alpine
detach: true
commands:
- redis-server --appendonly yes
expose:
- 6379
- name: market-redis-healthy
image: bash
commands:
- while ! nc -z market-redis 6379 ; do sleep 1 ; done && echo "market-redis ready"
depends_on:
- market-redis
- name: result-proxy-mongo
image: library/mongo:4.2
detach: true
commands:
- mongod --bind_ip_all --port 13202
expose:
- 13202
- name: result-proxy-mongo-healthy
image: bash
commands:
- while ! nc -z result-proxy-mongo 13202 ; do sleep 1 ; done && echo "result-proxy-mongo ready"
depends_on:
- result-proxy-mongo
- name: graphnode-postgres
image: postgres:12
detach: true
commands:
- docker-entrypoint.sh postgres -cshared_preload_libraries=pg_stat_statements
expose:
- 5432
environment:
POSTGRES_USER: graphnode
POSTGRES_PASSWORD: password
POSTGRES_DB: graphnode-db
- name: graphnode-postgres-healthy
image: bash
commands:
- while ! nc -z graphnode-postgres 5432 ; do sleep 1 ; done && echo "graphnode-postgres ready"
depends_on:
- graphnode-postgres
- name: graphnode
image: graphprotocol/graph-node:v0.27.0
detach: true
expose:
- 8000
- 8020
environment:
postgres_host: graphnode-postgres
postgres_port: 5432
postgres_user: graphnode
postgres_pass: password
postgres_db: graphnode-db
ipfs: ipfs:5001
ethereum: bellecour:http://bellecour-fork:8545
commands:
- export GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- ipfs-healthy
- graphnode-postgres-healthy
- name: graphnode-healthy
image: bash
commands:
- while ! nc -z graphnode 8020 ; do sleep 1 ; done && echo "graphnode admin ready"
- while ! nc -z graphnode 8000 ; do sleep 1 ; done && echo "graphnode gql ready"
depends_on:
- graphnode
- name: sms
image: iexechub/iexec-sms:7.1.0
detach: true
environment:
TZ: Europe/Paris
IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
IEXEC_TEE_WORKER_PRE_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-pre-compute:7.1.0-sconify-5.3.15-debug
IEXEC_TEE_WORKER_PRE_COMPUTE_FINGERPRINT: 9f0f782d6edc611baa23ca0978f555ee58ea70e092640c961e75c25e9e4b0f22
IEXEC_TEE_WORKER_PRE_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_TEE_WORKER_POST_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-post-compute:7.1.1-sconify-5.3.15-debug
IEXEC_TEE_WORKER_POST_COMPUTE_FINGERPRINT: face1376b97131e2dc75a556381d47a2e03bed9e1bc11e462471f99d1eefae50
IEXEC_TEE_WORKER_POST_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_IGNORED_SGX_ADVISORIES: INTEL-SA-00161,INTEL-SA-00289,INTEL-SA-00334,INTEL-SA-00381,INTEL-SA-00389,INTEL-SA-00220,INTEL-SA-00270,INTEL-SA-00293,INTEL-SA-00320,INTEL-SA-00329,INTEL-SA-00477
IEXEC_SCONE_TOLERATED_INSECURE_OPTIONS: debug-mode,hyperthreading,outdated-tcb
IEXEC_SMS_DISPLAY_DEBUG_SESSION: 'true'
IEXEC_SCONE_CAS_HOST: foo
IEXEC_SMS_IMAGE_LAS_IMAGE: foo
expose:
- 13300
depends_on:
- bellecour-fork-healthy
- name: sms-healthy
image: bash
commands:
- while ! nc -z sms 13300 ; do sleep 1 ; done && echo "sms ready"
depends_on:
- sms
- name: result-proxy
image: iexechub/iexec-result-proxy:7.1.0
detach: true
environment:
IEXEC_PRIVATE_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_PUBLIC_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: result-proxy-mongo
MONGO_PORT: 13202
IEXEC_IPFS_HOST: ipfs
expose:
- 13200
depends_on:
- bellecour-fork-healthy
- ipfs-healthy
- result-proxy-mongo-healthy
- name: result-proxy-healthy
image: bash
commands:
- while ! nc -z result-proxy 13200 ; do sleep 1 ; done && echo "result-proxy ready"
depends_on:
- result-proxy
- name: market-watcher
image: iexechub/iexec-market-watcher:6.4
detach: true
environment:
CHAIN: BELLECOUR
ETH_WS_HOST: ws://bellecour-fork:8545
ETH_RPC_HOST: http://bellecour-fork:8545
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
commands:
- export START_BLOCK=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cd /app
- npm start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api
image: iexechub/iexec-market-api:6.4
detach: true
expose:
- 3000
environment:
CHAINS: BELLECOUR_FORK
BELLECOUR_FORK_ETH_RPC_HOST: http://bellecour-fork:8545
BELLECOUR_FORK_CHAIN_ID: 134
BELLECOUR_FORK_IS_NATIVE: 'true'
BELLECOUR_FORK_IEXEC_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
RATE_LIMIT_MAX: 10000
RATE_LIMIT_PERIOD: 60000
MAX_OPEN_ORDERS_PER_WALLET: 1000
depends_on:
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api-healthy
image: bash
commands:
- while ! nc -z market-api 3000 ; do sleep 1 ; done && echo "market-api ready"
depends_on:
- market-api
- market-watcher
- name: subgraph-deploy
image: node:18.19
environment:
START_BLOCK: $BELLECOUR_FORK_BLOCK
GRAPHNODE_URL: http://graphnode:8020
IPFS_URL: http://ipfs:5001
commands:
- git clone --single-branch -b main https://github.com/iExecBlockchainComputing/dataprotector-sdk.git
- rm -rf dataprotector-subgraph && cp -r dataprotector-sdk/packages/subgraph dataprotector-subgraph
- rm -rf dataprotector-sdk && cd dataprotector-subgraph
- npm ci
- export START_BLOCK=$(cat ../local-stack-env/BELLECOUR_FORK_BLOCK)
- npm run all
depends_on:
- prepare-local-stack-env
- ipfs-healthy
- graphnode-healthy
- name: stack-ready
image: bash
commands:
- echo "all services ready"
depends_on:
- bellecour-fork-healthy
- sms-healthy
- result-proxy-healthy
- market-api-healthy
- ipfs-healthy
- graphnode-healthy
- subgraph-deploy
##### START LOCAL STACK END #####
- name: install
image: node:18.19
pull: always
commands:
- node -v
- npm -v
- npm ci
- name: format
image: node:18.19
commands:
- npm run check-format
depends_on:
- install
- name: lint
image: node:18.19
commands:
- npm run lint
depends_on:
- install
- name: check-types
image: node:18.19
commands:
- npm run check-types
depends_on:
- install
- name: test
image: node:18.19
commands:
- npm run test
depends_on:
- install
- stack-ready
- name: build
image: node:18.19
commands:
- npm run build
depends_on:
- install
- name: authenticate
image: robertstettner/drone-npm-auth
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
depends_on:
- format
- lint
- check-types
- test
- build
- name: deprecate-old-nightly-version
image: node:18.19
pull: always
commands:
- apt-get update && apt-get install -y jq
# fetches the latest nightly version of the @iexec/web3mail package from npm registry
- PREVIOUS_NIGHTLY_VERSION=$(npm show @iexec/web3mail versions --json | jq -r 'map(select(test("nightly"))) | .[-1]')
- if [ -n "$PREVIOUS_NIGHTLY_VERSION" ]; then npm deprecate @iexec/web3mail@$PREVIOUS_NIGHTLY_VERSION "Deprecate $PREVIOUS_NIGHTLY_VERSION"; fi
depends_on:
- format
- lint
- check-types
- test
- build
- name: set-version-nightly
image: node:18.19
commands:
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
depends_on:
- format
- lint
- check-types
- test
- build
- deprecate-old-nightly-version
- name: publish
image: plugins/npm
pull: always
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: nightly
access: public
depends_on:
- format
- lint
- check-types
- test
- build
- deprecate-old-nightly-version
- set-version-nightly
---
# sdk @iexec/web3mail publish npm latest pipeline
kind: pipeline
type: docker
name: sdk-publish-latest
trigger:
event:
- promote
target:
- sdk-latest
branch:
- main
steps:
##### START LOCAL STACK #####
- name: prepare-local-stack-env
image: node
commands:
- node tests/prepare-test-env.js
- name: bellecour-fork
detach: true
image: ghcr.io/foundry-rs/foundry:latest
pull: always
expose:
- 8545
commands:
- anvil --host 0.0.0.0 --port 8545 --block-time 1 --hardfork berlin --fork-url $(cat local-stack-env/BELLECOUR_FORK_URL) --fork-block-number $(cat local-stack-env/BELLECOUR_FORK_BLOCK) --chain-id 134 --gas-limit 6700000 --gas-price 0
depends_on:
- prepare-local-stack-env
- name: bellecour-fork-healthy
image: bash
commands:
- while ! nc -z bellecour-fork 8545 ; do sleep 1 ; done && echo "bellecour-fork ready"
depends_on:
- bellecour-fork
- name: ipfs
image: ipfs/go-ipfs:v0.9.1
detach: true
expose:
- 8080
- 5001
- name: ipfs-healthy
image: bash
commands:
- while ! nc -z ipfs 8080 ; do sleep 1 ; done && echo "ipfs gateway ready"
- while ! nc -z ipfs 5001 ; do sleep 1 ; done && echo "ipfs upload ready"
depends_on:
- ipfs
- name: market-mongo
image: mongo:6.0.3
detach: true
expose:
- 27017
- name: market-mongo-healthy
image: bash
commands:
- while ! nc -z market-mongo 27017 ; do sleep 1 ; done && echo "market-mongo ready"
depends_on:
- market-mongo
- name: market-redis
image: redis:7.0.7-alpine
detach: true
commands:
- redis-server --appendonly yes
expose:
- 6379
- name: market-redis-healthy
image: bash
commands:
- while ! nc -z market-redis 6379 ; do sleep 1 ; done && echo "market-redis ready"
depends_on:
- market-redis
- name: result-proxy-mongo
image: library/mongo:4.2
detach: true
commands:
- mongod --bind_ip_all --port 13202
expose:
- 13202
- name: result-proxy-mongo-healthy
image: bash
commands:
- while ! nc -z result-proxy-mongo 13202 ; do sleep 1 ; done && echo "result-proxy-mongo ready"
depends_on:
- result-proxy-mongo
- name: graphnode-postgres
image: postgres:12
detach: true
commands:
- docker-entrypoint.sh postgres -cshared_preload_libraries=pg_stat_statements
expose:
- 5432
environment:
POSTGRES_USER: graphnode
POSTGRES_PASSWORD: password
POSTGRES_DB: graphnode-db
- name: graphnode-postgres-healthy
image: bash
commands:
- while ! nc -z graphnode-postgres 5432 ; do sleep 1 ; done && echo "graphnode-postgres ready"
depends_on:
- graphnode-postgres
- name: graphnode
image: graphprotocol/graph-node:v0.27.0
detach: true
expose:
- 8000
- 8020
environment:
postgres_host: graphnode-postgres
postgres_port: 5432
postgres_user: graphnode
postgres_pass: password
postgres_db: graphnode-db
ipfs: ipfs:5001
ethereum: bellecour:http://bellecour-fork:8545
commands:
- export GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- ipfs-healthy
- graphnode-postgres-healthy
- name: graphnode-healthy
image: bash
commands:
- while ! nc -z graphnode 8020 ; do sleep 1 ; done && echo "graphnode admin ready"
- while ! nc -z graphnode 8000 ; do sleep 1 ; done && echo "graphnode gql ready"
depends_on:
- graphnode
- name: sms
image: iexechub/iexec-sms:7.1.0
detach: true
environment:
TZ: Europe/Paris
IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
IEXEC_TEE_WORKER_PRE_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-pre-compute:7.1.0-sconify-5.3.15-debug
IEXEC_TEE_WORKER_PRE_COMPUTE_FINGERPRINT: 9f0f782d6edc611baa23ca0978f555ee58ea70e092640c961e75c25e9e4b0f22
IEXEC_TEE_WORKER_PRE_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_TEE_WORKER_POST_COMPUTE_IMAGE: docker.io/iexechub/tee-worker-post-compute:7.1.1-sconify-5.3.15-debug
IEXEC_TEE_WORKER_POST_COMPUTE_FINGERPRINT: face1376b97131e2dc75a556381d47a2e03bed9e1bc11e462471f99d1eefae50
IEXEC_TEE_WORKER_POST_COMPUTE_HEAP_SIZE_GB: 4
IEXEC_IGNORED_SGX_ADVISORIES: INTEL-SA-00161,INTEL-SA-00289,INTEL-SA-00334,INTEL-SA-00381,INTEL-SA-00389,INTEL-SA-00220,INTEL-SA-00270,INTEL-SA-00293,INTEL-SA-00320,INTEL-SA-00329,INTEL-SA-00477
IEXEC_SCONE_TOLERATED_INSECURE_OPTIONS: debug-mode,hyperthreading,outdated-tcb
IEXEC_SMS_DISPLAY_DEBUG_SESSION: 'true'
IEXEC_SCONE_CAS_HOST: foo
IEXEC_SMS_IMAGE_LAS_IMAGE: foo
expose:
- 13300
depends_on:
- bellecour-fork-healthy
- name: sms-healthy
image: bash
commands:
- while ! nc -z sms 13300 ; do sleep 1 ; done && echo "sms ready"
depends_on:
- sms
- name: result-proxy
image: iexechub/iexec-result-proxy:7.1.0
detach: true
environment:
IEXEC_PRIVATE_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_PUBLIC_CHAIN_ADDRESS: http://bellecour-fork:8545
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: result-proxy-mongo
MONGO_PORT: 13202
IEXEC_IPFS_HOST: ipfs
expose:
- 13200
depends_on:
- bellecour-fork-healthy
- ipfs-healthy
- result-proxy-mongo-healthy
- name: result-proxy-healthy
image: bash
commands:
- while ! nc -z result-proxy 13200 ; do sleep 1 ; done && echo "result-proxy ready"
depends_on:
- result-proxy
- name: market-watcher
image: iexechub/iexec-market-watcher:6.4
detach: true
environment:
CHAIN: BELLECOUR
ETH_WS_HOST: ws://bellecour-fork:8545
ETH_RPC_HOST: http://bellecour-fork:8545
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
commands:
- export START_BLOCK=$(cat local-stack-env/BELLECOUR_FORK_BLOCK)
- cd /app
- npm start
depends_on:
- prepare-local-stack-env
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api
image: iexechub/iexec-market-api:6.4
detach: true
expose:
- 3000
environment:
CHAINS: BELLECOUR_FORK
BELLECOUR_FORK_ETH_RPC_HOST: http://bellecour-fork:8545
BELLECOUR_FORK_CHAIN_ID: 134
BELLECOUR_FORK_IS_NATIVE: 'true'
BELLECOUR_FORK_IEXEC_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
MONGO_HOST: market-mongo
REDIS_HOST: market-redis
RATE_LIMIT_MAX: 10000
RATE_LIMIT_PERIOD: 60000
MAX_OPEN_ORDERS_PER_WALLET: 1000
depends_on:
- bellecour-fork-healthy
- market-redis-healthy
- market-mongo-healthy
- name: market-api-healthy
image: bash
commands:
- while ! nc -z market-api 3000 ; do sleep 1 ; done && echo "market-api ready"
depends_on:
- market-api
- market-watcher
- name: subgraph-deploy
image: node:18.19
environment:
START_BLOCK: $BELLECOUR_FORK_BLOCK
GRAPHNODE_URL: http://graphnode:8020
IPFS_URL: http://ipfs:5001
commands:
- git clone --single-branch -b main https://github.com/iExecBlockchainComputing/dataprotector-sdk.git
- rm -rf dataprotector-subgraph && cp -r dataprotector-sdk/packages/subgraph dataprotector-subgraph
- rm -rf dataprotector-sdk && cd dataprotector-subgraph
- npm ci
- export START_BLOCK=$(cat ../local-stack-env/BELLECOUR_FORK_BLOCK)
- npm run all
depends_on:
- prepare-local-stack-env
- ipfs-healthy
- graphnode-healthy
- name: stack-ready
image: bash
commands:
- echo "all services ready"
depends_on:
- bellecour-fork-healthy
- sms-healthy
- result-proxy-healthy
- market-api-healthy
- ipfs-healthy
- graphnode-healthy
- subgraph-deploy
##### START LOCAL STACK END #####
- name: install
image: node:18.19
pull: always
commands: