@govuk-pay/cli 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/package.json +4 -1
  2. package/resources/legacy-ruby-cli/README.md +10 -3
  3. package/resources/legacy-ruby-cli/config/secrets.yml +35 -64
  4. package/resources/legacy-ruby-cli/config/service_secrets.yml +4 -7
  5. package/resources/legacy-ruby-cli/lib/pay_cli/commands/aws.rb +0 -22
  6. package/resources/legacy-ruby-cli/lib/pay_cli/commands/doctor.rb +0 -1
  7. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/config.rb +4 -0
  8. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/config.yaml +2 -0
  9. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/docker.rb +33 -3
  10. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/all.yaml +120 -54
  11. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/card.yaml +25 -42
  12. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/docker-compose.erb +110 -5
  13. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/services/egress/squid.conf +47 -0
  14. package/resources/legacy-ruby-cli/lib/pay_cli/commands/local.rb +40 -9
  15. package/resources/legacy-ruby-cli/lib/pay_cli/commands/ssm.rb +7 -60
  16. package/resources/legacy-ruby-cli/lib/pay_cli/entry_point.rb +0 -11
  17. package/resources/legacy-ruby-cli/lib/pay_cli/environment.rb +1 -1
  18. package/resources/legacy-ruby-cli/lib/pay_cli/secrets.rb +1 -1
  19. package/resources/usageDetails.txt +1 -0
  20. package/src/commands/tunnel.js +370 -0
  21. package/src/core/commandRouter.js +4 -0
  22. package/src/core/constants.js +19 -1
  23. package/resources/legacy-ruby-cli/lib/pay_cli/aws/document.rb +0 -23
  24. package/resources/legacy-ruby-cli/lib/pay_cli/ec2.rb +0 -38
  25. package/resources/legacy-ruby-cli/vulnerability_scan/.nvmrc +0 -1
  26. package/resources/legacy-ruby-cli/vulnerability_scan/generate_vulnerability_report.js +0 -88
  27. package/resources/legacy-ruby-cli/vulnerability_scan/package.json +0 -15
  28. package/resources/legacy-ruby-cli/vulnerability_scan/scan.sh +0 -88
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govuk-pay/cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "GOV.UK Pay Command Line Interface",
5
5
  "bin": {
6
6
  "pay": "bin/cli.js",
@@ -11,6 +11,9 @@
11
11
  "author": "",
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
+ "@aws-sdk/client-ec2": "^3.641.0",
15
+ "@aws-sdk/client-ecs": "^3.637.0",
16
+ "@aws-sdk/client-rds": "^3.637.0",
14
17
  "openurl": "^1.1.1",
15
18
  "ts-standard": "^12.0.2"
16
19
  },
@@ -7,7 +7,7 @@
7
7
  ```
8
8
  cd $PRJ_ROOT/cli
9
9
  rbenv install
10
- rbenv exec gem install bundler
10
+ gem install bundler
11
11
  bundle install
12
12
  ```
13
13
 
@@ -19,6 +19,14 @@ gem install nokogiri -v 1.8.4 -- --use-system-libraries=true --with-xml2-include
19
19
 
20
20
  then re-running `bundle install`)
21
21
 
22
+ (if you receive an error relating to `nokogiri` try running:
23
+
24
+ ```
25
+ gem install nokogiri -v 1.8.4 -- --use-system-libraries=true --with-xml2-include="$(xcrun --show-sdk-path)"/usr/include/libxml2
26
+ ```
27
+
28
+ then re-running `bundle install`)
29
+
22
30
  ### add the following to your `.bash_profile`, `.bashrc`, or `.zshrc`
23
31
 
24
32
  In all of the following examples replace `~/Code/pay-infra` or `$HOME/Code/pay-infra` with the path where you have the
@@ -34,7 +42,7 @@ or if you want to avoid ruby version conflicts then you can instead use the foll
34
42
  ```
35
43
  function pay {
36
44
  pushd "$HOME/Code/pay-infra/cli" >>/dev/null 2>&1 || return
37
- rbenv exec bundle exec bin/pay "$@"
45
+ bundle exec bin/pay "$@"
38
46
  popd >>/dev/null 2>&1 || return
39
47
  }
40
48
  ```
@@ -140,4 +148,3 @@ You can run a single spec by adding the line number:
140
148
  ```
141
149
  bundle exec rspec spec/lib/pay_cli/commands/local/image_extractor_spec.rb:11
142
150
  ```
143
-
@@ -1,40 +1,12 @@
1
1
  ---
2
- # secrets here will be looked up from pay-dev-pass
3
- # pay-dev-pass[env][service][secretname] = pay-dev-pass path
4
- pay-dev-pass:
5
- deploy:
6
- cd-pay-deploy:
7
- pact-broker-password: pact/pact_broker_password
8
- pact-broker-username: pact/pact_broker_username
9
- pact-broker/pact-broker-password: pact/pact_broker_password
10
- pact-broker/pact-broker-username: pact/pact_broker_username
11
- cd-pay-dev:
12
- pact-broker-password: pact/pact_broker_password
13
- pact-broker-username: pact/pact_broker_username
14
- pr-ci/pact-broker-username: pact/pact_broker_username
15
- pr-ci/pact-broker-password: pact/pact_broker_password
16
- pact-broker-auth:
17
- pact-broker-basic-auth-password: pact/pact_broker_password
18
- pact-broker-basic-auth-username: pact/pact_broker_username
19
- test-12:
20
- connector:
21
- SANDBOX_AUTH_TOKEN: notifications/test/sandbox_auth_token
22
- test-perf-1:
23
- connector:
24
- SANDBOX_AUTH_TOKEN: notifications/test/sandbox_auth_token
25
- staging-2:
26
- connector:
27
- SANDBOX_AUTH_TOKEN: notifications/staging/sandbox_auth_token
28
- production-2:
29
- connector:
30
- SANDBOX_AUTH_TOKEN: notifications/production/sandbox_auth_token
31
- frontend:
32
- GOOGLE_PAY_MERCHANT_ID: google_pay/merchant_identifier
33
- GOOGLE_PAY_MERCHANT_ID_2: google_pay/merchant_identifier_2
34
2
  # secrets here will be looked up from pay-low-pass
35
3
  # pay-low-pass[env][service][secretname] = pay-low-pass path
36
4
  pay-low-pass:
37
5
  deploy:
6
+ worldpay_secure_file_gateway:
7
+ private-key: worldpay/secure_file_gateway/worldpay_secure_file_gateway.rsa
8
+ public-key: worldpay/secure_file_gateway/worldpay_secure_file_gateway.rsa.pub
9
+ passphrase: worldpay/secure_file_gateway/passphrase
38
10
  alb_and_s3_logging_pipeline:
39
11
  firehose_hec_token: splunk/firehose-hec-token
40
12
  amazon-managed-prometheus:
@@ -51,7 +23,13 @@ pay-low-pass:
51
23
  end-to-end/docker-access-token: dockerhub/concourse-access-token
52
24
  github-access-token: alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token
53
25
  grafana-annotations-password: concourse/grafana_annotations
26
+ pact-broker-password: pact/pact_broker_password
27
+ pact-broker-username: pact/pact_broker_username
28
+ pact-broker/pact-broker-password: pact/pact_broker_password
29
+ pact-broker/pact-broker-username: pact/pact_broker_username
54
30
  slack-notification-secret: slack/notification-secret
31
+ internal-vulnerability-scan/jira-api-username: jira/concourse-ci/username
32
+ internal-vulnerability-scan/jira-api-token: jira/concourse-ci/internal-vulnerability-scan/api-token
55
33
  cd-pay-dev:
56
34
  docker-email: dockerhub/concourse-email
57
35
  docker-username: dockerhub/concourse-username
@@ -59,6 +37,8 @@ pay-low-pass:
59
37
  docker-access-token: dockerhub/concourse-access-token
60
38
  github-access-token: alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token
61
39
  grafana-annotations-password: concourse/grafana_annotations
40
+ pact-broker-password: pact/pact_broker_password
41
+ pact-broker-username: pact/pact_broker_username
62
42
  pay-js-commons/github-access-token: alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token
63
43
  pr-ci/github-access-token: alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token
64
44
  slack-notification-secret: slack/notification-secret
@@ -72,6 +52,9 @@ pay-low-pass:
72
52
  docker-password: dockerhub/concourse-password
73
53
  docker-access-token: dockerhub/concourse-access-token
74
54
  slack-notification-secret: slack/notification-secret
55
+ pact-broker-auth:
56
+ pact-broker-basic-auth-password: pact/pact_broker_password
57
+ pact-broker-basic-auth-username: pact/pact_broker_username
75
58
  deploy-7:
76
59
  deploy:
77
60
  PAGER_DUTY_CLOUDWATCH_INTEGRATION_URL: pager-duty/govuk-pay/amazon-cloudwatch-integration-url
@@ -110,17 +93,16 @@ pay-low-pass:
110
93
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_SECONDARY: apple_pay/worldpay/test/payment-processing-certificate-20230906
111
94
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY_SECONDARY: apple_pay/worldpay/test/payment-processing-private-key-20230906 # pragma: allowlist secret
112
95
  SENTRY_DSN: sentry_io/connector_dsn
113
- failwhale:
114
- google-analytics-id: google-analytics/failwhale/test/google-analytics-id
96
+ SANDBOX_AUTH_TOKEN: smoke-test-api-token/notifications/test_sandbox_auth_token
115
97
  frontend:
116
98
  SESSION_ENCRYPTION_KEY: ""
117
99
  SESSION_ENCRYPTION_KEY_2: ""
118
100
  WORLDPAY_APPLE_PAY_MERCHANT_ID: apple_pay/worldpay/test/merchant-id
119
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/test/merchant-id-certificate-20230905
120
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/test/merchant-id-certificate-key-20230905
101
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/test/merchant-id-certificate-20240730
102
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/test/merchant-id-certificate-key-20240730
121
103
  STRIPE_APPLE_PAY_MERCHANT_ID: apple_pay/stripe/test/merchant-id
122
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/test/merchant-id-certificate-20230823
123
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/test/merchant-id-certificate-key-20230823
104
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/test/merchant-id-certificate-20240730
105
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/test/merchant-id-certificate-key-20240730
124
106
  STRIPE_TEST_PUBLISHABLE_API_KEY: stripe/test/test/publishable-api-key
125
107
  STRIPE_LIVE_PUBLISHABLE_API_KEY: stripe/test/test/publishable-api-key
126
108
  SENTRY_DSN: sentry/frontend_dsn
@@ -208,15 +190,16 @@ pay-low-pass:
208
190
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_SECONDARY: apple_pay/worldpay/test/payment-processing-certificate-20230906
209
191
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY_SECONDARY: apple_pay/worldpay/test/payment-processing-private-key-20230906 # pragma: allowlist secret
210
192
  SENTRY_DSN: sentry_io/connector_dsn
193
+ SANDBOX_AUTH_TOKEN: smoke-test-api-token/notifications/test_sandbox_auth_token
211
194
  frontend:
212
195
  SESSION_ENCRYPTION_KEY: ""
213
196
  SESSION_ENCRYPTION_KEY_2: ""
214
197
  WORLDPAY_APPLE_PAY_MERCHANT_ID: apple_pay/worldpay/test/merchant-id
215
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/test/merchant-id-certificate-20230905
216
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/test/merchant-id-certificate-key-20230905
198
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/test/merchant-id-certificate-20240730
199
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/test/merchant-id-certificate-key-20240730
217
200
  STRIPE_APPLE_PAY_MERCHANT_ID: apple_pay/stripe/test/merchant-id
218
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/test/merchant-id-certificate-20230823
219
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/test/merchant-id-certificate-key-20230823
201
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/test/merchant-id-certificate-20240730
202
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/test/merchant-id-certificate-key-20240730
220
203
  STRIPE_TEST_PUBLISHABLE_API_KEY: stripe/test/test/publishable-api-key
221
204
  STRIPE_LIVE_PUBLISHABLE_API_KEY: stripe/test/test/publishable-api-key
222
205
  SENTRY_DSN: sentry/frontend_dsn
@@ -292,13 +275,6 @@ pay-low-pass:
292
275
  docker-username: dockerhub/concourse-username
293
276
  docker-access-token: dockerhub/concourse-access-token
294
277
  github-access-token: alphagov-pay-ci-concourse/github.com-concourse-github-personal-access-token
295
- worldpay_secure_file_gateway:
296
- private-key: worldpay/secure_file_gateway/worldpay_secure_file_gateway.rsa
297
- public-key: worldpay/secure_file_gateway/worldpay_secure_file_gateway.rsa.pub
298
- passphrase: worldpay/secure_file_gateway/passphrase
299
- ci:
300
- alb_and_s3_logging_pipeline:
301
- firehose_hec_token: splunk/firehose-hec-token
302
278
  staging-2:
303
279
  adminusers:
304
280
  DB_PASSWORD: aws/rds/application_users/staging/adminusers1
@@ -322,8 +298,7 @@ pay-low-pass:
322
298
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_SECONDARY: apple_pay/worldpay/test/payment-processing-certificate-20230906
323
299
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY_SECONDARY: apple_pay/worldpay/test/payment-processing-private-key-20230906 # pragma: allowlist secret
324
300
  SENTRY_DSN: sentry_io/connector_dsn
325
- failwhale:
326
- google-analytics-id: google-analytics/failwhale/staging/google-analytics-id
301
+ SANDBOX_AUTH_TOKEN: smoke-test-api-token/notifications/staging_sandbox_auth_token
327
302
  frontend:
328
303
  WORLDPAY_APPLE_PAY_MERCHANT_ID: apple_pay/worldpay/test/merchant-id
329
304
  WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/test/merchant-id-certificate-20230905
@@ -418,19 +393,20 @@ pay-low-pass:
418
393
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_SECONDARY: apple_pay/worldpay/production/payment-processing-certificate-20230906
419
394
  WORLDPAY_APPLE_PAY_PAYMENT_PROCESSING_PRIVATE_KEY_SECONDARY: apple_pay/worldpay/production/payment-processing-private-key-20230906 # pragma: allowlist secret
420
395
  SENTRY_DSN: sentry_io/connector_dsn
421
- failwhale:
422
- google-analytics-id: google-analytics/failwhale/production/google-analytics-id
396
+ SANDBOX_AUTH_TOKEN: smoke-test-api-token/notifications/production_sandbox_auth_token
423
397
  frontend:
424
398
  WORLDPAY_APPLE_PAY_MERCHANT_ID: apple_pay/worldpay/production/merchant-id
425
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/production/merchant-id-certificate-20230906
426
- WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/production/merchant-id-certificate-key-20230906
399
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/worldpay/production/merchant-id-certificate-20240730
400
+ WORLDPAY_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/worldpay/production/merchant-id-certificate-key-20240730
427
401
  STRIPE_APPLE_PAY_MERCHANT_ID: apple_pay/stripe/production/merchant-id
428
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/production/merchant-id-certificate-20230823
429
- STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/production/merchant-id-certificate-key-20230823
402
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE: apple_pay/stripe/production/merchant-id-certificate-20240730
403
+ STRIPE_APPLE_PAY_MERCHANT_ID_CERTIFICATE_KEY: apple_pay/stripe/production/merchant-id-certificate-key-20240730
430
404
  STRIPE_TEST_PUBLISHABLE_API_KEY: stripe/production/test/publishable-api-key
431
405
  STRIPE_LIVE_PUBLISHABLE_API_KEY: stripe/production/live/publishable-api-key
432
406
  SENTRY_DSN: sentry/frontend_dsn
433
407
  SENTRY_CSP_REPORT_URI: sentry/frontend_csp_report_uri
408
+ GOOGLE_PAY_MERCHANT_ID: google_pay/merchant_identifier
409
+ GOOGLE_PAY_MERCHANT_ID_2: google_pay/merchant_identifier_2
434
410
  ledger:
435
411
  DB_PASSWORD: aws/rds/application_users/production/ledger
436
412
  DB_SUPPORT_PASSWORD_READONLY: aws/rds/support_readonly_users/production/ledger_support_readonly # pragma: allowlist secret
@@ -496,23 +472,20 @@ pay-low-pass:
496
472
  # secrets here are just regular values
497
473
  # value[env][service][key] = value
498
474
  value:
499
- ci-5:
500
- terraform:
501
- CHEF_ROLE: "build"
502
- PERF_ENV: "false"
503
475
  deploy:
504
476
  cd-pay-deploy:
505
477
  pay_aws_deploy_account_id: "424875624006"
506
478
  pay_aws_prod_account_id: "092359438320"
479
+ pay_aws_production_account_id: "092359438320"
507
480
  pay_aws_staging_account_id: "888564216586"
508
481
  pay_aws_test_account_id: "223851549868"
509
482
  pay-team-manual/github-username: "alphagov-pay-ci-concourse"
483
+ internal-vulnerability-scan/jira-base-url: "https://payments-platform.atlassian.net"
510
484
  cd-pay-dev:
511
485
  pay_aws_deploy_account_id: "424875624006"
512
486
  pay_aws_staging_account_id: "888564216586"
513
487
  pay_aws_test_account_id: "223851549868"
514
488
  pay_aws_dev_account_id: "673337093959" # pragma: allowlist secret
515
- pay_aws_ci_account_id: "687320788729" # pragma: allowlist secret
516
489
  dev-fg-1:
517
490
  terraform:
518
491
  PERF_ENV: "false"
@@ -640,8 +613,6 @@ value:
640
613
  products:
641
614
  DB_USER: "products"
642
615
  DB_SUPPORT_USER_READONLY: "products_support_readonly"
643
- performance-slack:
644
- SLACK_URI: "https://hooks.slack.com/services/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"
645
616
  toolbox:
646
617
  AUTH_GITHUB_VIEW_ONLY_TEAM_ID: "7196958"
647
618
  AUTH_GITHUB_USER_SUPPORT_TEAM_ID: "3304532"
@@ -44,8 +44,6 @@ pact-broker:
44
44
  pact-broker-auth:
45
45
  - pact-broker-basic-auth-password
46
46
  - pact-broker-basic-auth-username
47
- failwhale:
48
- - google-analytics-id
49
47
  frontend:
50
48
  - GOOGLE_PAY_MERCHANT_ID
51
49
  - GOOGLE_PAY_MERCHANT_ID_2
@@ -99,8 +97,6 @@ selfservice:
99
97
  - ZENDESK_USER
100
98
  - STRIPE_ACCOUNT_API_KEY
101
99
  - SENTRY_DSN
102
- performance-slack:
103
- - SLACK_URI
104
100
  ledger:
105
101
  - DB_PASSWORD
106
102
  - DB_USER
@@ -135,12 +131,16 @@ cd-pay-deploy:
135
131
  - end-to-end/docker-access-token
136
132
  - github-access-token
137
133
  - grafana-annotations-password
134
+ - internal-vulnerability-scan/jira-api-username
135
+ - internal-vulnerability-scan/jira-api-token
136
+ - internal-vulnerability-scan/jira-base-url
138
137
  - pact-broker-username
139
138
  - pact-broker-password
140
139
  - pact-broker/pact-broker-password
141
140
  - pact-broker/pact-broker-username
142
141
  - pay_aws_deploy_account_id
143
142
  - pay_aws_prod_account_id
143
+ - pay_aws_production_account_id
144
144
  - pay_aws_staging_account_id
145
145
  - pay_aws_test_account_id
146
146
  - slack-notification-secret
@@ -156,12 +156,9 @@ cd-pay-dev:
156
156
  - pay_aws_deploy_account_id
157
157
  - pay_aws_staging_account_id
158
158
  - pay_aws_test_account_id
159
- - pay_aws_ci_account_id
160
159
  - pay_aws_dev_account_id
161
160
  - pay-js-commons/github-access-token
162
161
  - pr-ci/github-access-token
163
- - pr-ci/pact-broker-username
164
- - pr-ci/pact-broker-password
165
162
  - slack-notification-secret
166
163
  - smartpay-expected-password
167
164
  - smartpay-expected-user
@@ -14,20 +14,6 @@ class PayCLI::Commands::Aws < Thor
14
14
  exit 0
15
15
  end
16
16
 
17
- desc 'cli <account>', 'opens aws-shell with credentials for <account>'
18
- def cli(account)
19
- PayCLI::Environment.setup! account
20
-
21
- STDERR.puts
22
-
23
- pid = spawn(
24
- 'aws-shell',
25
- in: STDIN, out: STDOUT, err: STDERR
26
- )
27
- Process.wait pid
28
- exit $CHILD_STATUS.exitstatus
29
- end
30
-
31
17
  desc 'cmd <account> <*args>',
32
18
  'runs args in aws with credentials for <account>'
33
19
  def cmd(account, *args)
@@ -40,12 +26,4 @@ class PayCLI::Commands::Aws < Thor
40
26
  Process.wait pid
41
27
  exit $CHILD_STATUS.exitstatus
42
28
  end
43
-
44
- desc 'document_security_groups <env>',
45
- 'creates the documentation for the security groups for PCI for <env>'
46
- def document_security_groups(account)
47
- PayCLI::Environment.setup! account
48
- PayCLI::Aws::Document.security_group_rules! account
49
- end
50
-
51
29
  end
@@ -118,7 +118,6 @@ class PayCLI::Commands::Doctor
118
118
 
119
119
  def check_aws!
120
120
  ensure_executable!("aws")
121
- ensure_executable!("aws-shell")
122
121
  end
123
122
 
124
123
  def ensure_executable!(executable, instructions_if_missing = nil)
@@ -33,6 +33,10 @@ module PayCLI::Commands::Local::Config
33
33
  @apps.select {|app| app[:name] == app_name}.map {|app| app[:proxy_port]}.first
34
34
  end
35
35
 
36
+ def self.can_use_egress_proxy(app_name)
37
+ @apps.select {|app| app[:name] == app_name}.first.fetch(:can_use_egress_proxy, false)
38
+ end
39
+
36
40
  def self.cluster( cluster, apps)
37
41
  apps.select {|app| app[:clusters].include?(cluster)}
38
42
  end
@@ -23,6 +23,7 @@ connector:
23
23
  port: 9300
24
24
  admin_port: 9301
25
25
  healthcheck: true
26
+ can_use_egress_proxy: true
26
27
  queues:
27
28
  AWS_SQS_CAPTURE_QUEUE_URL: pay_capture_queue
28
29
  AWS_SQS_PAYMENT_EVENT_QUEUE_URL: pay_event_queue
@@ -102,6 +103,7 @@ frontend:
102
103
  debug_port: 9001
103
104
  proxy_port: 29000
104
105
  healthcheck: true
106
+ can_use_egress_proxy: true
105
107
  clusters:
106
108
  - paymentlinks
107
109
  - card
@@ -4,6 +4,36 @@ module PayCLI::Commands::Local::Docker
4
4
  STDERR.puts " 💀 #{app}"
5
5
  end
6
6
 
7
+ def self.cleanup_old_network
8
+ if `docker network ls --format json --filter 'name=files_default' | wc -l`.chomp.strip != "0"
9
+ STDERR.puts "Cleaning up old docker network 'files_default'"
10
+ STDERR.puts `docker network rm files_default`
11
+ end
12
+ end
13
+
14
+ def self.remove_network
15
+ cleanup_old_network
16
+
17
+ STDERR.print " 💀 network -- "
18
+
19
+ if `docker network ls --format json --filter 'name=pay_local_mimic_aws_vpc' | wc -l`.chomp.strip == "0"
20
+ STDERR.puts "No networks to remove"
21
+ return
22
+ end
23
+
24
+ STDERR.puts `docker network rm pay_local_mimic_aws_vpc 2>/dev/null`
25
+ end
26
+
27
+ def self.restart(cluster, app_name)
28
+ STDERR.puts "😅 restarting #{app_name}"
29
+
30
+ puts `docker compose -f #{compose_file cluster} restart #{app_name}`
31
+ end
32
+
33
+ def self.compose_file_exists_for_cluster?(cluster)
34
+ File.file?(compose_file cluster)
35
+ end
36
+
7
37
  def self.write_compose_file(cluster, binding)
8
38
  compose_file = compose_file cluster
9
39
 
@@ -16,15 +46,15 @@ module PayCLI::Commands::Local::Docker
16
46
  end
17
47
 
18
48
  def self.pull(cluster)
19
- `docker-compose -f #{compose_file cluster} pull`
49
+ `docker compose -f #{compose_file cluster} pull`
20
50
  end
21
51
 
22
52
  def self.up(cluster)
23
- `docker-compose -f #{compose_file cluster} up --detach`
53
+ `docker compose -f #{compose_file cluster} up --detach`
24
54
  end
25
55
 
26
56
  def self.down(cluster)
27
- `docker-compose --log-level ERROR -f #{compose_file cluster} down`
57
+ `docker compose -f #{compose_file cluster} down`
28
58
  end
29
59
 
30
60
  def self.compose_file(cluster)