@govuk-pay/cli 0.0.22 → 0.0.23

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.22",
3
+ "version": "0.0.23",
4
4
  "description": "GOV.UK Pay Command Line Interface",
5
5
  "bin": {
6
6
  "pay": "bin/cli.js",
package/readme.md CHANGED
@@ -40,6 +40,21 @@ use the command `legacy`, for example:
40
40
 
41
41
  Please add an issue any time you need to fall back on legacy behaviour so we can improve the typescript implementation.
42
42
 
43
+ ### Config files
44
+
45
+ Config files needed by the pay cli will go in `$HOME/.pay-cli"
46
+
47
+ #### Pay Local Config Files
48
+
49
+ You can override environment variables set in the the .env files in [the pay local services local config directory](https://github.com/alphagov/pay-cli/tree/main/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/services` for
50
+ specific containers by placing files in `$HOME/.pay-cli/local/environment-overrides/<app_name>.env`.
51
+
52
+ For example to override an environment variable for connector which was set in [connector.env](https://github.com/alphagov/pay-cli/blob/main/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/services/connector.env)
53
+ you could create the file `$HOME/.pay-cli/local/environment-overrides/connector.env`
54
+
55
+ Note: This will only override variables set in the .env files, it will not override any variables which get declared in an `environment` configuration option in the generated docker-compose files. These are generated from the
56
+ [docker-compose.erb](https://github.com/alphagov/pay-cli/blob/main/resources/legacy-ruby-cli/lib/pay_cli/commands/local/files/docker-compose.erb#L5) template.
57
+
43
58
  ## Vulnerability Disclosure
44
59
 
45
60
  GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. Please refer to our [vulnerability disclosure policy](https://www.gov.uk/help/report-vulnerability) and our [security.txt](https://vdp.cabinetoffice.gov.uk/.well-known/security.txt) file for details.
@@ -32,6 +32,9 @@ services:
32
32
  env_file:
33
33
  - services/java_app.env
34
34
  - services/<%= app[:name] %>.env
35
+ <% if File.exist?(File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env")) %>
36
+ - <%= File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env") %>
37
+ <% end %>
35
38
  environment:
36
39
  - BIND_HOST=0.0.0.0
37
40
  - RUN_MIGRATION=true
@@ -116,6 +119,9 @@ services:
116
119
  env_file:
117
120
  - services/java_app.env
118
121
  - services/<%= app[:name] %>.env
122
+ <% if File.exist?(File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env")) %>
123
+ - <%= File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env") %>
124
+ <% end %>
119
125
  environment:
120
126
  - BIND_HOST=0.0.0.0
121
127
  - RUN_MIGRATION=true
@@ -199,7 +205,11 @@ services:
199
205
  <%= app[:name] %>_db:
200
206
  condition: service_healthy
201
207
  <% end %>
202
- env_file: services/<%= app[:name] %>.env
208
+ env_file:
209
+ - services/<%= app[:name] %>.env
210
+ <% if File.exist?(File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env")) %>
211
+ - <%= File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env") %>
212
+ <% end %>
203
213
  environment:
204
214
  - BIND_HOST=0.0.0.0
205
215
  - SECURE_COOKIE_OFF=true
@@ -254,7 +264,11 @@ services:
254
264
  <%= app[:name] %>_db:
255
265
  condition: service_healthy
256
266
  <% end %>
257
- env_file: services/<%= app[:name] %>.env
267
+ env_file:
268
+ - services/<%= app[:name] %>.env
269
+ <% if File.exist?(File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env")) %>
270
+ - <%= File.join(Dir.home, ".pay-cli", "local", "environment-overrides", "#{app[:name]}.env") %>
271
+ <% end %>
258
272
  <% if @mount_local_node_apps %>
259
273
  volumes:
260
274
  - "$WORKSPACE/pay-<%= app[:name] %>:/app"