-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
project.yaml
860 lines (860 loc) · 19.2 KB
/
project.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
.github:
env_var:
set:
GITHUB_ORG:
ssm: null
default: systemaccounting
GITHUB_REPO_NAME:
ssm: null
default: mxfactorial
params: []
codecov:
flags:
- unittest
- integration
- ui
workflows:
env_var:
set:
GITHUB_REGISTRY:
ssm: null
default: ghcr.io
IMAGE_BUILDER_WORKFLOW:
ssm: null
default: build-all-images.yaml
DEPLOY_IMAGE_WORKFLOW:
ssm: null
default: deploy-all-images.yaml
params: []
client:
runtime: v8
min_code_cov: null
type: app
deploy: true
local_dev: true
env_var:
set:
CLIENT_URI:
ssm: client/uri
default: null
CLIENT_PORT:
ssm: null
default: 10009
GOOGLE_MAPS_API_KEY:
ssm: null
# todo: precommit hook requiring null
default: null
get:
- POOL_ID
- CLIENT_ID
- GRAPHQL_URI
- CLIENT_PORT
- GOOGLE_MAPS_API_KEY
- GRAPHQL_SUBSCRIPTIONS_URI
params:
- ENABLE_API_AUTH
crates:
env_var: null
params: []
httpclient:
runtime: rust1.x
min_code_cov: 55
type: lib
env_var: null
params: []
pg:
runtime: rust1.x
min_code_cov: 27
type: lib
params: []
env_var:
set: null
get:
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
types:
runtime: rust1.x
min_code_cov: 93
type: lib
env_var: null
params: []
uribuilder:
runtime: rust1.x
min_code_cov: 0
type: lib
env_var: null
params: []
wsclient:
runtime: rust1.x
min_code_cov: 0
type: lib
env_var: null
params: []
docker:
env_var:
set:
DOCKER_USER:
ssm: null
default: mxfactorial
LOCAL_TAG_VERSION:
ssm: null
default: latest
infra:
terraform:
env_var:
set:
TFSTATE_EXT:
ssm: null
default: tfstate
TFSTATE_ENV_SUFFIX:
ssm: null
default: env_infra
aws:
environments:
region:
env_var:
set:
TFSTATE_APIGW_SUFFIX:
ssm: null
default: apigw_logging
modules:
env_var:
set:
LAMBDA_RUNTIME:
ssm: null
default: provided.al2023
environment:
env_var:
set:
PGDATABASE:
ssm: database/sql/postgres/pgdatabase
default: mxfactorial
PGUSER:
ssm: database/sql/postgres/pguser
default: test
PGPASSWORD:
ssm: database/sql/postgres/pgpassword
default: test
PGHOST:
ssm: database/sql/postgres/pghost
default: localhost
PGPORT:
ssm: database/sql/postgres/pgport
default: 5432
CLIENT_ID:
ssm: auth/cognito/client_id
default: null
POOL_ID:
ssm: auth/cognito/pool_id
default: null
COGNITO_JWKS_URI:
ssm: auth/cognito/jwks/uri
default: null
SECRET:
ssm: auth/cognito/test_account/secret
default: null
ENABLE_API_AUTH:
ssm: null
default: false
REGION:
ssm: null
default: us-east-1
RDS_PREFIX:
ssm: null
default: mxfactorial
SSM_VERSION:
ssm: null
default: v1
GRAPHQL_URI:
ssm: api/graphql/uri
default: null # scripts/create-env-file.sh sets as localhost:$PORT
GRAPHQL_SUBSCRIPTIONS_URI:
ssm: null
default: null
REQUEST_CREATE_URL:
ssm: service/lambda/request_create/url
default: null
REQUEST_APPROVE_URL:
ssm: service/lambda/request_approve/url
default: null
RULE_URL:
ssm: service/lambda/rule/url
default: null
REQUEST_BY_ID_URL:
ssm: service/lambda/request_by_id/url
default: null
REQUESTS_BY_ACCOUNT_URL:
ssm: service/lambda/requests_by_account/url
default: null
TRANSACTION_BY_ID_URL:
ssm: service/lambda/transaction_by_id/url
default: null
TRANSACTIONS_BY_ACCOUNT_URL:
ssm: service/lambda/transactions_by_account/url
default: null
BALANCE_BY_ACCOUNT_URL:
ssm: service/lambda/balance_by_account/url
default: null
RDS_INSTANCE_NAME_PREFIX:
ssm: null
default: mxfactorial
READINESS_CHECK_PATH:
ssm: service/lambda/readiness_check_path
default: /healthz
microk8s:
env_var:
set:
MICROK8S_SSH_PUB_KEY:
ssm: ops/ec2/microk8s/ssh/pub_key
default: null
MICROK8S_SSH_PRIV_KEY:
ssm: ops/ec2/microk8s/ssh/priv_key
default: null
MICROK8S_SSH_USER:
ssm: null
default: ubuntu
MICROK8S_SSH_HOST:
ssm: ops/ec2/microk8s/ssh/host
default: null
MICROK8S_SSH_PORT:
ssm: null
default: 22
MICROK8S_SSH_KEY_NAME_PREFIX:
ssm: null
default: microk8s
MICROK8S_MANIFESTS_DIR:
ssm: null
default: k8s
project-storage:
env_var:
set:
DDB_TABLE_NAME_PREFIX:
ssm: null
default: github-workflows
DDB_TABLE_HASH_KEY:
ssm: null
default: GithubSha
DDB_TABLE_TTL_ATTR:
ssm: null
default: ttl
DYNAMODB_TTL_DAYS:
ssm: null
default: 1
DDB_TABLE_PENDING_TESTS_ATTR:
ssm: null
default: PendingTests
ARTIFACTS_BUCKET_PREFIX:
ssm: null
default: mxfactorial-artifacts
CLIENT_ORIGIN_BUCKET_PREFIX:
ssm: null
default: mxfactorial-client
TFSTATE_BUCKET_PREFIX:
ssm: null
default: mxfactorial-tfstate
k8s:
local:
type: lib
params: []
env_var:
set: null
get:
- CLIENT_PORT
- PGPORT
- GRAPHQL_PORT
- RULE_PORT
- REQUEST_CREATE_PORT
- REQUEST_APPROVE_PORT
- BALANCE_BY_ACCOUNT_PORT
- REQUEST_BY_ID_PORT
- REQUESTS_BY_ACCOUNT_PORT
- TRANSACTION_BY_ID_PORT
- TRANSACTIONS_BY_ACCOUNT_PORT
- PGDATABASE
- PGUSER
- PGPASSWORD
- PGHOST
- READINESS_CHECK_PATH
- GITHUB_REGISTRY
- GITHUB_ORG
- GITHUB_REPO_NAME
- REDIS_DB
- REDIS_HOST
- REDIS_PORT
- REDIS_USERNAME
- REDIS_PASSWORD
- MEASURE_PORT
- RETURN_RECORD_LIMIT
dev:
type: lib
params: []
env_var:
set: null
get:
- PGDATABASE
- PGUSER
- PGPASSWORD
- PGHOST
- PGPORT
- REDIS_DB
- REDIS_HOST
- REDIS_PORT
- REDIS_USERNAME
- REDIS_PASSWORD
- MEASURE_PORT
- READINESS_CHECK_PATH
- GITHUB_REGISTRY
- GITHUB_ORG
- GITHUB_REPO_NAME
migrations:
type: lib
params: []
env_var:
set:
SQL_TYPE:
ssm: null
default: postgres
get:
- SQL_TYPE
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
dumps:
env_var:
set:
TESTSEED_DUMP_PATH:
ssm: null
default: ./migrations/dumps/testseed.sql
go-migrate:
runtime: bash
min_code_cov: null
type: app
local_dev: false
params:
- AWS_REGION
deploy: true
build_src_path: null
dependents:
env_var:
set: []
get:
- SQL_TYPE
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
testseed:
env_var:
set:
TEST_ACCOUNTS_FILE:
ssm: null
default: ./migrations/testseed/000001_accounts.up.sql
scripts:
env_var:
set:
IAM_USER:
ssm: null
default: mxgitpod
USER_POLICY_ARN:
ssm: null
default: arn:aws:iam::aws:policy/AdministratorAccess
COMPOSE_DIR:
ssm: null
default: ./docker
BUILD_DB:
ssm: null
default: true
BUILD_CACHE:
ssm: null
default: true
TEST_ACCOUNTS_MIGRATION_FILE:
ssm: null
default: ./migrations/testseed/000001_accounts.up.sql
REQUIRED_PID_COUNT:
ssm: null
default: 11
LOCAL_RESTART_LIMIT:
ssm: null
default: 3
RESTART_SLEEP_SECONDS:
ssm: null
default: 5
CUSTOM_IFS:
ssm: null
default: '|'
SERVICE_PROCESSES:
ssm: null
default:
- 'cargo-watch'
CI_SERVICE_PROCESSES:
ssm: null
default:
- 'target/debug'
CLIENT_PROCESS:
ssm: null
default: 'bin/vite dev'
ADDED_PROCESSES_TO_TERM:
ssm: null
default:
- 'npm run dev'
- 'npm run build'
- 'vite build'
- 'tail -F'
SERVICES_ZIP:
ssm: null
default: mxfactorial.zip
SHORT_GIT_SHA_LENGTH:
ssm: null
default: 7
services:
env_var:
set:
BINARY_NAME:
ssm: null
default: bootstrap
LAMBDA_INVOKE_LOG:
ssm: null
default: invoke.log
RETURN_RECORD_LIMIT:
ssm: null
default: 20
graphql:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params:
- AWS_REGION
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
GRAPHQL_PORT:
ssm: null
default: 10000
get:
- RULE_URL
- REQUEST_CREATE_URL
- REQUEST_APPROVE_URL
- REQUEST_BY_ID_URL
- REQUESTS_BY_ACCOUNT_URL
- TRANSACTIONS_BY_ACCOUNT_URL
- TRANSACTION_BY_ID_URL
- BALANCE_BY_ACCOUNT_URL
- READINESS_CHECK_PATH
- GRAPHQL_PORT
- MEASURE_URL
- MEASURE_RESOURCE
- RUST_LOG
request-create:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params:
- AWS_REGION
deploy: true
build_src_path: null
dependents:
- request-approve
rust_log: off
env_var:
set:
REQUEST_CREATE_PORT:
ssm: null
default: 10002
get:
- READINESS_CHECK_PATH
- RULE_URL
- REQUEST_CREATE_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
request-approve:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params:
- AWS_REGION
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
REQUEST_APPROVE_PORT:
ssm: null
default: 10003
get:
- READINESS_CHECK_PATH
- REQUEST_APPROVE_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
rule:
runtime: rust1.x
min_code_cov: 49
type: app
local_dev: true
params:
- AWS_REGION
deploy: true
build_src_path: null
dependents:
- request-create
rust_log: off
env_var:
set:
RULE_PORT:
ssm: null
default: 10001
HOSTNAME_OR_IP:
ssm: null
default: localhost
RUST_LOG:
ssm: null
# set by scripts/create-env-file.sh
# https://docs.rs/env_logger/latest/env_logger/#enabling-logging
default: null
RUST_BACKTRACE:
ssm: null
default: 1
get:
- PGDATABASE
- PGUSER
- PGPASSWORD
- PGHOST
- PGPORT
- CLIENT_ID
- POOL_ID
- GRAPHQL_URI
- READINESS_CHECK_PATH
- RULE_PORT
- HOSTNAME_OR_IP
- RUST_LOG
- RUST_BACKTRACE
request-by-id:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
REQUEST_BY_ID_PORT:
ssm: null
default: 10005
get:
- REQUEST_BY_ID_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- READINESS_CHECK_PATH
requests-by-account:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
REQUESTS_BY_ACCOUNT_PORT:
ssm: null
default: 10006
get:
- REQUESTS_BY_ACCOUNT_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- READINESS_CHECK_PATH
- RETURN_RECORD_LIMIT
transaction-by-id:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
TRANSACTION_BY_ID_PORT:
ssm: null
default: 10007
get:
- TRANSACTION_BY_ID_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- READINESS_CHECK_PATH
transactions-by-account:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
TRANSACTIONS_BY_ACCOUNT_PORT:
ssm: null
default: 10008
get:
- TRANSACTIONS_BY_ACCOUNT_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- READINESS_CHECK_PATH
- RETURN_RECORD_LIMIT
balance-by-account:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
BALANCE_BY_ACCOUNT_PORT:
ssm: null
default: 10004
get:
- BALANCE_BY_ACCOUNT_PORT
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- READINESS_CHECK_PATH
event:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: false
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
REDIS_DB:
ssm: null
default: 0
REDIS_HOST:
ssm: null
default: localhost
REDIS_PORT:
ssm: null
default: 6379
REDIS_USERNAME:
ssm: null
default: default
REDIS_PASSWORD:
ssm: null
default: test
get:
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- REDIS_DB
- REDIS_HOST
- REDIS_PORT
- REDIS_USERNAME
- REDIS_PASSWORD
- RUST_LOG
measure:
runtime: rust1.x
min_code_cov: null
type: app
local_dev: true
params: []
deploy: false
build_src_path: null
dependents: []
rust_log: off
env_var:
set:
MEASURE_PORT:
ssm: null
default: 10010
MEASURE_URL:
ssm: null
default: null # script sets as $LOCAL_ADDRESS:$PORT
MEASURE_RESOURCE:
ssm: null
default: ws
get:
- PGHOST
- PGPORT
- PGUSER
- PGPASSWORD
- PGDATABASE
- REDIS_DB
- REDIS_HOST
- REDIS_PORT
- REDIS_USERNAME
- REDIS_PASSWORD
- MEASURE_PORT
- READINESS_CHECK_PATH
- RUST_LOG
auto-confirm:
runtime: rust1.x
min_code_cov: null
type: app
params: []
deploy: true
build_src_path: null
dependents: []
rust_log: off
env_var:
get: # used by make targets
- POOL_ID
- CLIENT_ID
tests:
runtime: rust1.x
type: tool
deploy: false
env_var:
set:
AWS_LAMBDA_FUNCTION_NAME:
ssm: null
default: 1
get:
- GRAPHQL_URI
- RULE_URL
- REQUEST_CREATE_URL
- REQUEST_APPROVE_URL
- REQUEST_BY_ID_URL
- REQUESTS_BY_ACCOUNT_URL
- TRANSACTIONS_BY_ACCOUNT_URL
- TRANSACTION_BY_ID_URL
- BALANCE_BY_ACCOUNT_URL
- AWS_LAMBDA_FUNCTION_NAME # used when testing cloud envs
params: []
env_var:
set:
ENV_FILE_NAME:
ssm: null
default: .env
LOCAL_ADDRESS:
ssm: null
default: localhost
NOHUP_LOG:
ssm: null
default: nohup.out
ENV_ID:
ssm: null
default: null # set by script
PROD_ENV_ID:
ssm: null
default: 0
get:
- CLIENT_URI
- GRAPHQL_URI
params: []
# .tools as list to support sequenced install scripting
.tools:
- name: docker
os:
osx:
install: 'if ! command docker -v >/dev/null 2>&1; then echo -e "\033[1;33minstall docker from https://docs.docker.com/desktop/install/mac-install/ before continuing\033[0m"; exit 1; fi'
- name: brew
os:
osx:
install: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
- name: node
os:
osx:
install: 'brew install node'
- name: awscli
os:
osx:
install: 'brew install awscli'
- name: tfswitch
os:
osx:
install: 'brew install warrensbox/tap/tfswitch'
- name: tfswitch
os:
osx:
install: 'brew install warrensbox/tap/tfswitch'
- name: libpq
os:
osx:
install: 'brew install libpq && brew link --force libpq'
- name: golang-migrate
os:
osx:
install: 'brew install golang-migrate'
- name: yq
os:
osx:
install: 'brew install yq'
- name: eslint
os:
osx:
install: 'npm install -g eslint'
- name: rust
os:
osx:
install: "curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y"
- name: llvm-tools-preview
os:
osx:
install: 'rustup component add llvm-tools-preview --toolchain stable-x86_64-apple-darwin'
- name: cross
os:
osx:
install: 'cargo install cross --git https://github.com/cross-rs/cross'
- name: cargo-watch
os:
osx:
install: 'cargo install cargo-watch'
- name: cargo-llvm-cov
os:
osx:
install: 'cargo install cargo-llvm-cov'
- name: ytt
os:
osx:
install: 'brew tap carvel-dev/carvel && brew install ytt'