@govuk-pay/cli 0.0.12 → 0.0.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govuk-pay/cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "GOV.UK Pay Command Line Interface",
5
5
  "bin": {
6
6
  "pay": "bin/cli.js",
@@ -1342,8 +1342,8 @@ GEM
1342
1342
  http-cookie (>= 1.0.2, < 2.0)
1343
1343
  mime-types (>= 1.16, < 4.0)
1344
1344
  netrc (~> 0.8)
1345
- rexml (3.2.8)
1346
- strscan (>= 3.0.9)
1345
+ rexml (3.3.3)
1346
+ strscan
1347
1347
  rgl (0.5.9)
1348
1348
  pairing_heap (>= 0.3.0)
1349
1349
  rexml (~> 3.2, >= 3.2.4)
@@ -3,42 +3,4 @@ module PayCLI::Naming
3
3
  microservice = 'www' if microservice == 'frontend'
4
4
  "#{env}-#{microservice}-ecs-appserver"
5
5
  end
6
-
7
- def self.elb_names(env, services)
8
- services
9
- .map { |s| s.gsub(/notifications/, 'notices') }
10
- .map { |s| "#{env}-#{s}-ecs-elb" }
11
- .zip(services)
12
- .to_h
13
- end
14
-
15
- def self.domain_name(env)
16
- acc = env.split('-').first
17
-
18
- case acc
19
- when 'deploy', 'staging', 'production'
20
- 'payments.service.gov.uk'
21
- else
22
- 'pymnt.uk'
23
- end
24
- end
25
-
26
- def self.bucket_name(env)
27
- acc = env.split('-').first
28
-
29
- case acc
30
- when 'dev', 'test'
31
- 'pay-govuk-terraform-state-ci'
32
- when 'staging', 'production'
33
- 'pay-govuk-terraform-state-deploy'
34
- else
35
- "pay-govuk-terraform-state-#{acc}"
36
- end
37
- end
38
-
39
- def self.db_name(env, service)
40
- microservice = service['service_name'].gsub(/_db$/, '')
41
- version = service.dig('instance_version', env) || '0'
42
- "#{env}-#{microservice}-rds-#{version}"
43
- end
44
6
  end
@@ -16,68 +16,4 @@ RSpec.describe 'pay naming' do
16
16
  )).to eq('env-name-cardid-ecs-appserver')
17
17
  end
18
18
  end
19
-
20
- context 'elb names' do
21
- it 'elb names to be correct' do
22
- names = PayCLI::Naming.elb_names(
23
- 'env-name',
24
- %w(adminusers connector products publicauth notifications ledger)
25
- )
26
- expected_names = {
27
- 'env-name-adminusers-ecs-elb' => 'adminusers',
28
- 'env-name-connector-ecs-elb' => 'connector',
29
- 'env-name-products-ecs-elb' => 'products',
30
- 'env-name-publicauth-ecs-elb' => 'publicauth',
31
- 'env-name-notices-ecs-elb' => 'notifications',
32
- 'env-name-ledger-ecs-elb' => 'ledger',
33
- }
34
-
35
- expect(names).to eq(expected_names)
36
- end
37
- end
38
-
39
- context 'domain names' do
40
- it 'domain names to be correct' do
41
- expected_domain_names = %w(
42
- pymnt.uk pymnt.uk pymnt.uk
43
- payments.service.gov.uk payments.service.gov.uk payments.service.gov.uk
44
- pymnt.uk
45
- )
46
-
47
- actual_domain_names = %w(
48
- ci dev test deploy staging production blah
49
- ).map { |env| PayCLI::Naming.domain_name(env) }
50
-
51
- expect(actual_domain_names).to eq(expected_domain_names)
52
- end
53
- end
54
-
55
- context 'bucket names' do
56
- it 'ci bucket is correct' do
57
- expected_name = 'pay-govuk-terraform-state-ci'
58
- expect(%w( ci dev test ).all? do |e|
59
- PayCLI::Naming.bucket_name(e) == expected_name
60
- end).to eq(true)
61
- end
62
-
63
- it 'deploy bucket is correct' do
64
- expected_name = 'pay-govuk-terraform-state-deploy'
65
- expect(%w( staging production deploy ).all? do |e|
66
- PayCLI::Naming.bucket_name(e) == expected_name
67
- end).to eq(true)
68
- end
69
-
70
- it 'arbtrary-env bucket is correct' do
71
- expect(PayCLI::Naming.bucket_name('arbitrary')).to eq('pay-govuk-terraform-state-arbitrary')
72
- end
73
- end
74
-
75
- context 'db names' do
76
- it 'resolves instance name with no version specified' do
77
- service = { 'service_name' => 'connector' }
78
- expect(
79
- PayCLI::Naming.db_name('env-1', service)
80
- ).to eq('env-1-connector-rds-0')
81
- end
82
- end
83
19
  end