@automattic/vip 2.9.4 → 2.9.5
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/README.md +129 -71
- package/assets/dev-env.lando.template.yml.ejs +3 -6
- package/dist/bin/vip-dev-env-update.js +1 -0
- package/dist/bin/vip-wp.js +127 -53
- package/dist/lib/constants/dev-environment.js +13 -3
- package/dist/lib/dev-environment/dev-environment-cli.js +65 -54
- package/dist/lib/dev-environment/dev-environment-core.js +28 -17
- package/npm-shrinkwrap.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
VIP-CLI is your tool for interacting with and managing your VIP applications.
|
|
3
2
|
|
|
4
3
|
## Getting started
|
|
@@ -27,12 +26,23 @@ By default, we record information about the usage of this tool using an in-house
|
|
|
27
26
|
|
|
28
27
|
## Changelog
|
|
29
28
|
|
|
29
|
+
### 2.9.5 (26 April 2022)
|
|
30
|
+
|
|
31
|
+
- #1005 [dev-env] updateWordPress image improvements
|
|
32
|
+
- #1006 Remove renovate.json
|
|
33
|
+
- #1007 Set up CodeQL Scanning
|
|
34
|
+
- #1008 WP-CLI: Reattach Reconnect-Related Events After a Successful Reconnection
|
|
35
|
+
- #1009 Add ability to choose a PHP image to use
|
|
36
|
+
- #1010 [dev-env] Add Enterprise Search, XDebug, phpMyAdmin options to the config wizard.
|
|
37
|
+
|
|
30
38
|
### 2.9.4 (07 April 2022)
|
|
39
|
+
|
|
31
40
|
- #996 Clean up lint warnings
|
|
32
41
|
- #1001 Fix reconnect event listeners
|
|
33
42
|
- #1000 Bump socket.io-client from 4.0.1 to 4.4.1
|
|
34
43
|
|
|
35
44
|
### 2.9.3 (29 March 2022)
|
|
45
|
+
|
|
36
46
|
- #995 Add debug call to dev-envs handleCLIException
|
|
37
47
|
- #992 Add --debug flag to all commands
|
|
38
48
|
- #993 [dev-env] Fix in caching version list.
|
|
@@ -43,96 +53,109 @@ By default, we record information about the usage of this tool using an in-house
|
|
|
43
53
|
- #987 Add support for M1 Macs in the search-replace tests
|
|
44
54
|
|
|
45
55
|
### 2.9.2 (9 March 2022)
|
|
46
|
-
|
|
47
|
-
- #
|
|
48
|
-
- #
|
|
49
|
-
- #
|
|
56
|
+
|
|
57
|
+
- #980 [dev-env] Fix/tag formatting on stapled images
|
|
58
|
+
- #986 Clean the build folder prior to rebuilding it
|
|
59
|
+
- #985 Adding webP to the list of accepted extensions for files
|
|
60
|
+
- #972 Run tests in Windows Env
|
|
50
61
|
|
|
51
62
|
https://github.com/Automattic/vip/releases/tag/v2.9.2
|
|
52
63
|
|
|
53
64
|
### 2.9.1 (2 March 2022)
|
|
54
|
-
|
|
55
|
-
- #
|
|
65
|
+
|
|
66
|
+
- #982 Remove unused dependencies - Fixes Error: Cannot find module 'core-js'
|
|
67
|
+
- #978 [dev-env] Added phpmyadmin proxy value
|
|
56
68
|
|
|
57
69
|
https://github.com/Automattic/vip/releases/tag/v2.9.1
|
|
58
70
|
|
|
59
71
|
### 2.9.0 (1 March 2022)
|
|
60
|
-
|
|
61
|
-
- #
|
|
62
|
-
- #
|
|
63
|
-
- #
|
|
64
|
-
- #
|
|
65
|
-
- #
|
|
66
|
-
- #
|
|
67
|
-
- #
|
|
68
|
-
- #
|
|
69
|
-
- #
|
|
72
|
+
|
|
73
|
+
- #966 [dev-env] Dynamic WordPress Image List
|
|
74
|
+
- #975 [dev-env] prompt On Unselected Env
|
|
75
|
+
- #974 [dev-env] Corrections of text for -h menu in dev-env create
|
|
76
|
+
- #973 [dev-env] update Nginx image
|
|
77
|
+
- #971 [dev-env] Use custom add user command
|
|
78
|
+
- #964 [dev-env] Validate sql on import
|
|
79
|
+
- #970 [dev-env] Do not use /tmp as a userConfRoot
|
|
80
|
+
- #977 Fix flow errors
|
|
81
|
+
- #976 Fix/duplicate shortcut parameter
|
|
82
|
+
- #968 Update minimum Node version
|
|
70
83
|
|
|
71
84
|
https://github.com/Automattic/vip/releases/tag/v2.9.0
|
|
72
85
|
|
|
73
86
|
### 2.8.2 (27 January 2021)
|
|
74
|
-
|
|
75
|
-
- #
|
|
87
|
+
|
|
88
|
+
- #961 Fixes md5 calculation failing when search-replace is used
|
|
89
|
+
- #959 Fixes md5 calculation for SQL Imports on VIPd
|
|
76
90
|
|
|
77
91
|
https://github.com/Automattic/vip/releases/tag/v2.8.2
|
|
78
92
|
|
|
79
93
|
### 2.8.0 (25 January 2021)
|
|
80
|
-
|
|
81
|
-
- #
|
|
82
|
-
- #
|
|
83
|
-
- #
|
|
84
|
-
- #
|
|
94
|
+
|
|
95
|
+
- #952 FORNO-1047: Fix SQL Import for compressed files
|
|
96
|
+
- #955 Add Error prefix for "Failed to fetch logs" msg
|
|
97
|
+
- #946 Add support for the site logs tailing feature
|
|
98
|
+
- #953 [dev-env] Updated list of available wordpress images for dev-env
|
|
99
|
+
- #933 Update dependency debug to v4.3.3
|
|
85
100
|
|
|
86
101
|
https://github.com/Automattic/vip/releases/tag/v2.8.0
|
|
87
102
|
|
|
88
103
|
### 2.7.1 (10 January 2021)
|
|
104
|
+
|
|
89
105
|
- #950 Switch to npm-shrinkwrap
|
|
90
|
-
- #947
|
|
91
|
-
- #944
|
|
92
|
-
- #942
|
|
106
|
+
- #947 [dev-env] List all dev env alias
|
|
107
|
+
- #944 Add `vip whoami` command
|
|
108
|
+
- #942 Envvar: Show message when there is an attempt to change the New Relic key.
|
|
93
109
|
|
|
94
110
|
https://github.com/Automattic/vip/releases/tag/v2.7.1
|
|
95
111
|
|
|
96
112
|
### 2.7.0 (07 December 2021)
|
|
97
|
-
|
|
98
|
-
- #
|
|
99
|
-
- #
|
|
113
|
+
|
|
114
|
+
- #941 [dev-env] Bump lando CLI dependency
|
|
115
|
+
- #938 Hide roll back message after SQL Import failure for launched sites
|
|
116
|
+
- #936 Sets jest maxWorkers to 4
|
|
100
117
|
|
|
101
118
|
https://github.com/Automattic/vip/releases/tag/v2.7.0
|
|
102
119
|
|
|
103
120
|
### 2.6.0 (23 November 2021)
|
|
104
|
-
|
|
105
|
-
- #
|
|
106
|
-
- #
|
|
107
|
-
- #
|
|
108
|
-
- #
|
|
109
|
-
- #
|
|
110
|
-
- #
|
|
111
|
-
- #
|
|
121
|
+
|
|
122
|
+
- #921 [dev-env] Introuces update to change existing environment
|
|
123
|
+
- #928 [dev-env] Switch lando to use our fork
|
|
124
|
+
- #927 [dev-env] Handles user already exists during sql import
|
|
125
|
+
- #925 [dev-env] Fix the issue with dev-env update
|
|
126
|
+
- #924 FORNO-985 Increase SQL Import limit for unlaunched sites to 100GB
|
|
127
|
+
- #923 FORNO-943 Fixes a bug which prevents displaying SQL Import error messages
|
|
128
|
+
- #922 Update eslint-config-wpvip commit hash to c6605d1
|
|
129
|
+
- #873 Pin dependencies
|
|
112
130
|
|
|
113
131
|
### 2.5.0 (9 November 2021)
|
|
114
|
-
|
|
115
|
-
- #
|
|
116
|
-
- #
|
|
117
|
-
- #
|
|
132
|
+
|
|
133
|
+
- #919 [dev-env] Expose lando core logs
|
|
134
|
+
- #916 [dev-env] Save instance data state
|
|
135
|
+
- #914 [dev-env] update help wording for dev env
|
|
136
|
+
- #915 Add warning message when an envvar is set/deleted
|
|
118
137
|
|
|
119
138
|
### 2.4.0 (5 November 2021)
|
|
120
|
-
|
|
121
|
-
- #
|
|
139
|
+
|
|
140
|
+
- #913 [dev-env] No login required for dev-env
|
|
141
|
+
- #911 Adds more release instructions
|
|
122
142
|
|
|
123
143
|
### 2.3.1 (2 November 2021)
|
|
144
|
+
|
|
124
145
|
- Fixes an issue with the 2.3.0 where the intended changes didn't get published correctly.
|
|
125
146
|
|
|
126
147
|
### 2.3.0 (2 November 2021)
|
|
127
|
-
|
|
128
|
-
- #
|
|
129
|
-
- #
|
|
130
|
-
- #
|
|
131
|
-
- #
|
|
148
|
+
|
|
149
|
+
- #908 [dev-env] Custom user permissions setup
|
|
150
|
+
- #897 [dev-env] Primary domain prompt for primary domain redirect
|
|
151
|
+
- #902 [dev-env] Delete file permissions
|
|
152
|
+
- #900 Clarify CONTRIBUTING guidelines
|
|
153
|
+
- #905 Update contribution steps
|
|
132
154
|
|
|
133
155
|
### 2.2.0 (27 October 2021)
|
|
134
156
|
|
|
135
157
|
New: Environment variables command
|
|
158
|
+
|
|
136
159
|
- #896 Open config envvar command for all customers
|
|
137
160
|
- #876 Update envvar list command to only show names
|
|
138
161
|
- #879 Add config envvar get and get-all commands
|
|
@@ -140,6 +163,7 @@ New: Environment variables command
|
|
|
140
163
|
- #858 Environment variable CLI commands (list, set, delete)
|
|
141
164
|
|
|
142
165
|
Fixes:
|
|
166
|
+
|
|
143
167
|
- #901 Don't mark import as failed until restore has completed
|
|
144
168
|
- #899 Proxy fix + healthchecks
|
|
145
169
|
- #894 support windows db import
|
|
@@ -154,6 +178,7 @@ Fixes:
|
|
|
154
178
|
- #870 Add the VIP CLI release process and release schedule
|
|
155
179
|
|
|
156
180
|
Dependencies updates:
|
|
181
|
+
|
|
157
182
|
- #778 Update dependency ini to v2
|
|
158
183
|
- #786 Update dependency keytar to v7
|
|
159
184
|
- #884 Update dependency cli-columns to v4
|
|
@@ -166,28 +191,28 @@ https://github.com/Automattic/vip/releases/tag/v2.2.0
|
|
|
166
191
|
|
|
167
192
|
### 2.1.0 (16 September 2021)
|
|
168
193
|
|
|
169
|
-
- #857
|
|
170
|
-
- #864
|
|
171
|
-
- #868
|
|
172
|
-
- #862
|
|
173
|
-
- #867
|
|
174
|
-
- #863
|
|
175
|
-
- #855
|
|
176
|
-
- #856
|
|
177
|
-
- #849
|
|
178
|
-
- #854
|
|
179
|
-
- #850
|
|
180
|
-
- #853
|
|
181
|
-
- #851
|
|
182
|
-
- #852
|
|
183
|
-
- #843
|
|
184
|
-
- #848
|
|
185
|
-
- #847
|
|
186
|
-
- #840
|
|
187
|
-
- #845
|
|
188
|
-
- #846
|
|
189
|
-
- #842
|
|
190
|
-
- #839
|
|
194
|
+
- #857 Remove select DB checks
|
|
195
|
+
- #864 Adding WordPress versions to dev-env
|
|
196
|
+
- #868 persist database data in between container restarts
|
|
197
|
+
- #862 Fix lint warnings
|
|
198
|
+
- #867 Update dependency lando to v3.3.2
|
|
199
|
+
- #863 Add links to CONTRIBUTING and SECURITY
|
|
200
|
+
- #855 Add some helpful hints for new command scaffolding
|
|
201
|
+
- #856 Adding media import command on dev environment
|
|
202
|
+
- #849 Adding SQL import to dev environment
|
|
203
|
+
- #854 Updating command descriptions and arguments on dev-env
|
|
204
|
+
- #850 Use official memcached image on dev-env
|
|
205
|
+
- #853 Enable ssl forwarding on dev-env
|
|
206
|
+
- #851 Conditionally disabling statsd on mu-plugins
|
|
207
|
+
- #852 Fixing Prettier format annotation typo
|
|
208
|
+
- #843 Removing custom wp-config-defaults
|
|
209
|
+
- #848 Not using a prefix to all dev environments
|
|
210
|
+
- #847 Update dependency lando to v3.3.0
|
|
211
|
+
- #840 Use official Elasticsearch image on dev-env
|
|
212
|
+
- #845 Fix MariaDB healthcheck
|
|
213
|
+
- #846 dev-env: Update error message for directory prompt
|
|
214
|
+
- #842 Removing PHP parameter from dev environment
|
|
215
|
+
- #839 Use official MariaDB image and enable version selection on dev-env
|
|
191
216
|
|
|
192
217
|
https://github.com/Automattic/vip/releases/tag/v2.1.0
|
|
193
218
|
|
|
@@ -229,6 +254,7 @@ https://github.com/Automattic/vip/releases/tag/v2.0.13
|
|
|
229
254
|
https://github.com/Automattic/vip/releases/tag/v2.0.12
|
|
230
255
|
|
|
231
256
|
### 2.0.11 (5 August 2021)
|
|
257
|
+
|
|
232
258
|
- Handle parameter validation in a consistent way #795
|
|
233
259
|
- Fix error blocking data sync on CLI sites #810
|
|
234
260
|
- Update DB Engine check to reduce false positives #811
|
|
@@ -244,6 +270,7 @@ https://github.com/Automattic/vip/releases/tag/v2.0.12
|
|
|
244
270
|
https://github.com/Automattic/vip/releases/tag/2.0.11
|
|
245
271
|
|
|
246
272
|
### 2.0.10 (21 June 2021)
|
|
273
|
+
|
|
247
274
|
- Adds Media Import Abort subcommand
|
|
248
275
|
- Disables enterprise search by default
|
|
249
276
|
- Handles numbered slugs correctly
|
|
@@ -255,6 +282,7 @@ https://github.com/Automattic/vip/releases/tag/2.0.11
|
|
|
255
282
|
https://github.com/Automattic/vip/releases/tag/v2.0.10
|
|
256
283
|
|
|
257
284
|
### 2.0.9 (3 June 2021)
|
|
285
|
+
|
|
258
286
|
- Enable SQL import for all site types
|
|
259
287
|
- Bug fix for analytics errors causing some commands to fail
|
|
260
288
|
- Add the full changelog to the readme
|
|
@@ -264,6 +292,7 @@ https://github.com/Automattic/vip/releases/tag/v2.0.10
|
|
|
264
292
|
https://github.com/Automattic/vip/releases/tag/v2.0.9
|
|
265
293
|
|
|
266
294
|
### 2.0.8 (27 May 2021)
|
|
295
|
+
|
|
267
296
|
- [Beta] Media Import: Enable media imports for production WordPress applications
|
|
268
297
|
- SQL Import: Enable SQL Import for launched sites
|
|
269
298
|
- SQL Import: Enable SQL Import for multisite networks
|
|
@@ -272,6 +301,7 @@ https://github.com/Automattic/vip/releases/tag/v2.0.9
|
|
|
272
301
|
https://github.com/Automattic/vip/releases/tag/v2.0.8
|
|
273
302
|
|
|
274
303
|
### 2.0.7 (6 May 2021)
|
|
304
|
+
|
|
275
305
|
- SQL Import: Add additional multisite validations
|
|
276
306
|
- Update socket.io-client to 4.0.1
|
|
277
307
|
- Misc. dependency updates
|
|
@@ -279,33 +309,39 @@ https://github.com/Automattic/vip/releases/tag/v2.0.8
|
|
|
279
309
|
https://github.com/Automattic/vip/releases/tag/v2.0.7
|
|
280
310
|
|
|
281
311
|
### 2.0.6 (15 Apr 2021)
|
|
312
|
+
|
|
282
313
|
- SQL Import: Add additional checks for site type
|
|
283
314
|
|
|
284
315
|
https://github.com/Automattic/vip/releases/tag/v2.0.6
|
|
285
316
|
|
|
286
317
|
### 2.0.5 (8 Mar 2021)
|
|
318
|
+
|
|
287
319
|
- Fix a bug when comparing env data to selected environment #697
|
|
288
320
|
|
|
289
321
|
https://github.com/Automattic/vip/releases/tag/v2.0.5
|
|
290
322
|
|
|
291
323
|
### 2.0.4 (3 Mar 2021)
|
|
324
|
+
|
|
292
325
|
- Bump socket.io-client from 2.3.0 to 2.4.0 (Fixes WP-CLI in node 15+) #679
|
|
293
326
|
- Additional SQL import file static validations #669
|
|
294
327
|
|
|
295
328
|
https://github.com/Automattic/vip/releases/tag/v2.0.4
|
|
296
329
|
|
|
297
330
|
### 2.0.3 (19 Feb 2021)
|
|
331
|
+
|
|
298
332
|
- Improved SQL import validation around the use of TRIGGER
|
|
299
333
|
|
|
300
334
|
https://github.com/Automattic/vip/releases/tag/v2.0.3
|
|
301
335
|
|
|
302
336
|
### 2.0.2 (15 Feb 2021)
|
|
337
|
+
|
|
303
338
|
- Improved handling of debug output during search & replace
|
|
304
339
|
- Updated the vip-search-replace package to ^1.0.13
|
|
305
340
|
|
|
306
341
|
https://github.com/Automattic/vip/releases/tag/v2.0.2
|
|
307
342
|
|
|
308
343
|
### 2.0.1 (11 Feb 2021)
|
|
344
|
+
|
|
309
345
|
- SQL Import: Improved reporting of server-side failures
|
|
310
346
|
- SQL Import: Add ability to skip local validation
|
|
311
347
|
- Updated the vip-search-replace package to v1.0.12
|
|
@@ -314,6 +350,7 @@ https://github.com/Automattic/vip/releases/tag/v2.0.2
|
|
|
314
350
|
https://github.com/Automattic/vip/releases/tag/v2.0.1
|
|
315
351
|
|
|
316
352
|
### 2.0.0 (2 Feb 2021)
|
|
353
|
+
|
|
317
354
|
- Drops support for Node 8
|
|
318
355
|
- Added Security Policy
|
|
319
356
|
- Added SQL file import feature for new sites
|
|
@@ -322,37 +359,44 @@ https://github.com/Automattic/vip/releases/tag/v2.0.1
|
|
|
322
359
|
https://github.com/Automattic/vip/releases/tag/v2.0.0
|
|
323
360
|
|
|
324
361
|
### 1.12.1 (8 Sep 2020)
|
|
362
|
+
|
|
325
363
|
- Updated list of accepted special characters for media files for imports
|
|
326
364
|
|
|
327
365
|
https://github.com/Automattic/vip/releases/tag/v1.12.1
|
|
328
366
|
|
|
329
367
|
### 1.12.0 (21 Aug 2020)
|
|
368
|
+
|
|
330
369
|
- Added multisite support for media files validation
|
|
331
370
|
- Added Tracks for SQL and media file validation events
|
|
332
371
|
|
|
333
372
|
https://github.com/Automattic/vip/releases/tag/v1.12.0
|
|
334
373
|
|
|
335
374
|
### 1.11.2 (17 Aug 2020)
|
|
375
|
+
|
|
336
376
|
- Added support for multiple nested folders for the media file validation command
|
|
337
377
|
|
|
338
378
|
https://github.com/Automattic/vip/releases/tag/v1.11.2
|
|
339
379
|
|
|
340
380
|
### 1.11.1 (17 Aug 2020)
|
|
381
|
+
|
|
341
382
|
- Added fix to process the import validation subcommands
|
|
342
383
|
|
|
343
384
|
https://github.com/Automattic/vip/releases/tag/v1.11.1
|
|
344
385
|
|
|
345
386
|
### 1.11.0 (17 Aug 2020)
|
|
387
|
+
|
|
346
388
|
- Added `vip import validate sql` and `vip import validate files` commands to run static validation checks for SQL and media files for imports
|
|
347
389
|
|
|
348
390
|
https://github.com/Automattic/vip/releases/tag/v1.11.0
|
|
349
391
|
|
|
350
392
|
### 1.10.0 (12 Jun 2020)
|
|
393
|
+
|
|
351
394
|
- Added support for specifying a SOCKS proxy through the environment variable VIP_PROXY
|
|
352
395
|
|
|
353
396
|
https://github.com/Automattic/vip/releases/tag/v1.10.0
|
|
354
397
|
|
|
355
398
|
### 1.9.0 (30 Mar 2020)
|
|
399
|
+
|
|
356
400
|
- Added support for [opting out of usage tracking](https://github.com/Automattic/vip/tree/e54d9ee0ce2dd4725ca8718b3aba06db24306ad7#analytics) via `DO_NOT_TRACK` environment variable #547
|
|
357
401
|
- Fix interactive commands not working correctly #478
|
|
358
402
|
- Show usage information when an unsupported command is entered #527
|
|
@@ -361,6 +405,7 @@ https://github.com/Automattic/vip/releases/tag/v1.10.0
|
|
|
361
405
|
https://github.com/Automattic/vip/releases/tag/v1.9.0
|
|
362
406
|
|
|
363
407
|
### 1.8.0 (25 Sep 2019)
|
|
408
|
+
|
|
364
409
|
- Fixes around cancelling commands via Ctrl-C
|
|
365
410
|
- Gracefully handle remote command cancellation
|
|
366
411
|
- Enhance Rollbar logging for additional use cases
|
|
@@ -368,21 +413,25 @@ https://github.com/Automattic/vip/releases/tag/v1.9.0
|
|
|
368
413
|
https://github.com/Automattic/vip/releases/tag/v1.8.0
|
|
369
414
|
|
|
370
415
|
### 1.7.0 (15 Aug 15 2019)
|
|
416
|
+
|
|
371
417
|
- Resume long-running WP-CLI commands in case of network interruptions
|
|
372
418
|
|
|
373
419
|
https://github.com/Automattic/vip/releases/tag/v1.7.0
|
|
374
420
|
|
|
375
421
|
### 1.6.2 (25 Jul 2019)
|
|
422
|
+
|
|
376
423
|
- Corrected some install issues with the 1.6.0/1.6.1 releases.
|
|
377
424
|
|
|
378
425
|
https://github.com/Automattic/vip/releases/tag/v1.6.2
|
|
379
426
|
|
|
380
427
|
### 1.6.1 (25 Jul 2019)
|
|
428
|
+
|
|
381
429
|
- Intermittent release to test some issues with v1.6.0
|
|
382
430
|
|
|
383
431
|
https://github.com/Automattic/vip/releases/tag/v1.6.1
|
|
384
432
|
|
|
385
433
|
### 1.6.0 (25 Jul 2019)
|
|
434
|
+
|
|
386
435
|
- We added ability to cancel running commands.
|
|
387
436
|
- We fixed an issue with trailing characters such as line breaks affecting use of command output by scripts.
|
|
388
437
|
- Various dependancy updates.
|
|
@@ -390,6 +439,7 @@ https://github.com/Automattic/vip/releases/tag/v1.6.1
|
|
|
390
439
|
https://github.com/Automattic/vip/releases/tag/v1.6.0
|
|
391
440
|
|
|
392
441
|
### 1.5.0 (15 Jul 2019)
|
|
442
|
+
|
|
393
443
|
- Added `--yes` flag for WP-CLI commands to skip confirmation on production environments.
|
|
394
444
|
- We fixed the character limit errors raised when running long WP-CLI commands.
|
|
395
445
|
- We've added Rollbar to allow us to monitor and address errors
|
|
@@ -398,11 +448,13 @@ https://github.com/Automattic/vip/releases/tag/v1.6.0
|
|
|
398
448
|
https://github.com/Automattic/vip/releases/tag/v1.5.0
|
|
399
449
|
|
|
400
450
|
### 1.4.1 (29 Apr 2019)
|
|
451
|
+
|
|
401
452
|
- No functional changes, 1.4.0 was already taken on NPM :)
|
|
402
453
|
|
|
403
454
|
https://github.com/Automattic/vip/releases/tag/1.4.1
|
|
404
455
|
|
|
405
456
|
### 1.4.0 (29 Apr 2019)
|
|
457
|
+
|
|
406
458
|
- Added "environment alias" support (`vip @my-site.env sync`)
|
|
407
459
|
- Added support for WP-CLI commands
|
|
408
460
|
- Misc. dependency updates
|
|
@@ -410,6 +462,7 @@ https://github.com/Automattic/vip/releases/tag/1.4.1
|
|
|
410
462
|
https://github.com/Automattic/vip/releases/tag/1.4.0
|
|
411
463
|
|
|
412
464
|
### 1.3.0 (1 Feb 2019)
|
|
465
|
+
|
|
413
466
|
- We now display information header for every `vip app --app` execution [(#223)](https://github.com/Automattic/vip/pull/223).
|
|
414
467
|
- We fixed the logout bug asking the user to login before being able to logout [(#222)](https://github.com/Automattic/vip/pull/222) and we also display a message when a user logout [(#221)](https://github.com/Automattic/vip/pull/221).
|
|
415
468
|
- We replaced `inquirer` with `enquirer` [(#229)](https://github.com/Automattic/vip/pull/229).
|
|
@@ -420,11 +473,13 @@ https://github.com/Automattic/vip/releases/tag/1.4.0
|
|
|
420
473
|
https://github.com/Automattic/vip/releases/tag/v1.3.0
|
|
421
474
|
|
|
422
475
|
### 1.2.1 (5 Dec 2018)
|
|
476
|
+
|
|
423
477
|
- The `1.2.0` version was containing a bug and we published a patch to fix it. Please use this version instead.
|
|
424
478
|
|
|
425
479
|
https://github.com/Automattic/vip/releases/tag/v1.2.1
|
|
426
480
|
|
|
427
481
|
### 1.2.0 (5 Dec 2018)
|
|
482
|
+
|
|
428
483
|
- We now display a preview of the `sync` feature with the backup time and the search/replace taking place in your database.
|
|
429
484
|
- We now display your mapped domain instead of the placeholder `go-vip.co` domain in `vip app` and `vip app list`.
|
|
430
485
|
- We now display a better message when an app does not have any non-production environments.
|
|
@@ -434,11 +489,13 @@ https://github.com/Automattic/vip/releases/tag/v1.2.1
|
|
|
434
489
|
https://github.com/Automattic/vip/releases/tag/v1.2.0
|
|
435
490
|
|
|
436
491
|
### 1.1.1 (1 Nov 2018)
|
|
492
|
+
|
|
437
493
|
- Updates dependencies to fix a bug introduced by sub-dependencies.
|
|
438
494
|
|
|
439
495
|
https://github.com/Automattic/vip/releases/tag/v1.1.1
|
|
440
496
|
|
|
441
497
|
### 1.1.0 (12 Jul 2018)
|
|
498
|
+
|
|
442
499
|
- We now correctly report errors when `vip sync` fails. Previously, this would incorrectly report that a sync was run previously.
|
|
443
500
|
- We fixed permissions issues for some users with `admin` access for repos. They were unable to properly view and access applications.
|
|
444
501
|
- We now display more applications in `vip app list` (up to 100!) and have made it easier to browse through a large list thanks to (`$PAGER`|`less`) support. Previously you would only see the first 10 applications in your account.
|
|
@@ -448,6 +505,7 @@ https://github.com/Automattic/vip/releases/tag/v1.1.0
|
|
|
448
505
|
### 1.0.0 (2 Jul 2018)
|
|
449
506
|
|
|
450
507
|
The first release!
|
|
508
|
+
|
|
451
509
|
- `vip app list`: view a list of all your applications.
|
|
452
510
|
- `vip app`: view details about one of your applications.
|
|
453
511
|
- `vip sync`: trigger [a data sync](https://vip.wordpress.com/2018/03/28/data-sync-on-vip-go/) to synchronize data from your production environment to non-production environments.
|
|
@@ -22,7 +22,6 @@ services:
|
|
|
22
22
|
volumes:
|
|
23
23
|
devtools: {}
|
|
24
24
|
scripts:
|
|
25
|
-
|
|
26
25
|
nginx:
|
|
27
26
|
type: compose
|
|
28
27
|
ssl: true
|
|
@@ -37,11 +36,9 @@ services:
|
|
|
37
36
|
php:
|
|
38
37
|
type: compose
|
|
39
38
|
services:
|
|
40
|
-
image:
|
|
39
|
+
image: <%= php %>
|
|
41
40
|
command: run.sh
|
|
42
41
|
working_dir: /wp
|
|
43
|
-
healthcheck:
|
|
44
|
-
test: 'cat /wp/wp-includes/pomo/mo.php'
|
|
45
42
|
environment:
|
|
46
43
|
XDEBUG: <%= xdebug ? 'enable' : 'disable' %>
|
|
47
44
|
STATSD: <%= statsd ? 'enable' : 'disable' %>
|
|
@@ -95,7 +92,7 @@ services:
|
|
|
95
92
|
environment:
|
|
96
93
|
UPLOAD_LIMIT: 4G
|
|
97
94
|
<% } %>
|
|
98
|
-
|
|
95
|
+
<% if ( enterpriseSearchEnabled ) { %>
|
|
99
96
|
vip-search:
|
|
100
97
|
type: compose
|
|
101
98
|
services:
|
|
@@ -115,7 +112,7 @@ services:
|
|
|
115
112
|
- search_data:/usr/share/elasticsearch/data
|
|
116
113
|
volumes:
|
|
117
114
|
search_data:
|
|
118
|
-
|
|
115
|
+
<% } %>
|
|
119
116
|
<% if ( statsd ) { %>
|
|
120
117
|
statsd:
|
|
121
118
|
type: compose
|
|
@@ -58,6 +58,7 @@ cmd.argv(process.argv, async (arg, opt) => {
|
|
|
58
58
|
muPlugins: currentInstanceData.muPlugins.dir || currentInstanceData.muPlugins.tag || 'latest',
|
|
59
59
|
wordpress: currentInstanceData.wordpress.tag,
|
|
60
60
|
elasticsearch: currentInstanceData.elasticsearch,
|
|
61
|
+
php: currentInstanceData.php || _devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS.default,
|
|
61
62
|
mariadb: currentInstanceData.mariadb,
|
|
62
63
|
statsd: currentInstanceData.statsd,
|
|
63
64
|
phpmyadmin: currentInstanceData.phpmyadmin,
|
package/dist/bin/vip-wp.js
CHANGED
|
@@ -17,6 +17,8 @@ var _readline = _interopRequireDefault(require("readline"));
|
|
|
17
17
|
|
|
18
18
|
var _stream = require("stream");
|
|
19
19
|
|
|
20
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
21
|
+
|
|
20
22
|
var _api = _interopRequireWildcard(require("../lib/api"));
|
|
21
23
|
|
|
22
24
|
var _command = _interopRequireWildcard(require("../lib/cli/command"));
|
|
@@ -44,6 +46,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
44
46
|
/**
|
|
45
47
|
* Internal dependencies
|
|
46
48
|
*/
|
|
49
|
+
const debug = (0, _debug.default)('@automattic/vip:wp');
|
|
47
50
|
const appQuery = `id, name,
|
|
48
51
|
organization {
|
|
49
52
|
id
|
|
@@ -163,22 +166,11 @@ const cancelCommand = async guid => {
|
|
|
163
166
|
};
|
|
164
167
|
|
|
165
168
|
const launchCommandAndGetStreams = async ({
|
|
169
|
+
socket,
|
|
166
170
|
guid,
|
|
167
171
|
inputToken,
|
|
168
172
|
offset = 0
|
|
169
173
|
}) => {
|
|
170
|
-
const token = await _token.default.get();
|
|
171
|
-
const socket = (0, _socket.default)(`${_api.API_HOST}/wp-cli`, {
|
|
172
|
-
transportOptions: {
|
|
173
|
-
polling: {
|
|
174
|
-
extraHeaders: {
|
|
175
|
-
Authorization: `Bearer ${token.raw}`
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
agent: (0, _socksProxyAgent.default)()
|
|
180
|
-
});
|
|
181
|
-
|
|
182
174
|
const stdoutStream = _socket2.default.createStream();
|
|
183
175
|
|
|
184
176
|
const stdinStream = _socket2.default.createStream();
|
|
@@ -227,6 +219,111 @@ const launchCommandAndGetStreams = async ({
|
|
|
227
219
|
};
|
|
228
220
|
};
|
|
229
221
|
|
|
222
|
+
const bindReconnectEvents = ({
|
|
223
|
+
cliCommand,
|
|
224
|
+
inputToken,
|
|
225
|
+
subShellRl,
|
|
226
|
+
commonTrackingParams,
|
|
227
|
+
isSubShell
|
|
228
|
+
}) => {
|
|
229
|
+
currentJob.socket.io.removeAllListeners('reconnect');
|
|
230
|
+
currentJob.socket.io.removeAllListeners('reconnect_attempt');
|
|
231
|
+
currentJob.socket.removeAllListeners('retry');
|
|
232
|
+
currentJob.socket.io.on('reconnect', async () => {
|
|
233
|
+
debug('socket.io: reconnect');
|
|
234
|
+
|
|
235
|
+
_rollbar.rollbar.info('WP-CLI socket.io.on( \'reconnect\' )', {
|
|
236
|
+
custom: {
|
|
237
|
+
code: 'wp-cli-on-reconnect',
|
|
238
|
+
commandGuid: cliCommand.guid
|
|
239
|
+
}
|
|
240
|
+
}); // Close old streams
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
unpipeStreamsFromProcess({
|
|
244
|
+
stdin: currentJob.stdinStream,
|
|
245
|
+
stdout: currentJob.stdoutStream
|
|
246
|
+
});
|
|
247
|
+
(0, _tracker.trackEvent)('wpcli_command_reconnect', commonTrackingParams);
|
|
248
|
+
currentJob = await launchCommandAndGetStreams({
|
|
249
|
+
socket: currentJob.socket,
|
|
250
|
+
guid: cliCommand.guid,
|
|
251
|
+
inputToken: inputToken,
|
|
252
|
+
offset: currentOffset
|
|
253
|
+
}); // Rebind new streams
|
|
254
|
+
|
|
255
|
+
pipeStreamsToProcess({
|
|
256
|
+
stdin: currentJob.stdinStream,
|
|
257
|
+
stdout: currentJob.stdoutStream
|
|
258
|
+
});
|
|
259
|
+
bindStreamEvents({
|
|
260
|
+
subShellRl,
|
|
261
|
+
isSubShell,
|
|
262
|
+
commonTrackingParams,
|
|
263
|
+
stdoutStream: currentJob.stdoutStream
|
|
264
|
+
});
|
|
265
|
+
bindReconnectEvents({
|
|
266
|
+
cliCommand,
|
|
267
|
+
inputToken,
|
|
268
|
+
subShellRl,
|
|
269
|
+
commonTrackingParams,
|
|
270
|
+
isSubShell
|
|
271
|
+
}); // Resume readline interface
|
|
272
|
+
|
|
273
|
+
subShellRl.resume();
|
|
274
|
+
});
|
|
275
|
+
currentJob.socket.on('retry', async () => {
|
|
276
|
+
debug('socket: retry');
|
|
277
|
+
|
|
278
|
+
_rollbar.rollbar.info('WP-CLI socket.io.on( \'retry\' )', {
|
|
279
|
+
custom: {
|
|
280
|
+
code: 'wp-cli-on-retry',
|
|
281
|
+
commandGuid: cliCommand.guid
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
setTimeout(() => {
|
|
286
|
+
currentJob.socket.io.engine.close();
|
|
287
|
+
}, 5000);
|
|
288
|
+
});
|
|
289
|
+
currentJob.socket.on('exit', async ({
|
|
290
|
+
exitCode,
|
|
291
|
+
message
|
|
292
|
+
}) => {
|
|
293
|
+
debug('socket: exit. Code: %d. Message: %s', exitCode, message);
|
|
294
|
+
|
|
295
|
+
if (message) {
|
|
296
|
+
console.log(message);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
currentJob.stdinStream.destroy();
|
|
300
|
+
currentJob.stdoutStream.destroy();
|
|
301
|
+
currentJob.socket.close();
|
|
302
|
+
process.exit(exitCode);
|
|
303
|
+
});
|
|
304
|
+
currentJob.socket.io.on('reconnect_attempt', attempt => {
|
|
305
|
+
console.error('There was an error connecting to the server. Retrying...');
|
|
306
|
+
|
|
307
|
+
if (attempt > 1) {
|
|
308
|
+
return;
|
|
309
|
+
} // create a new input stream so that we can still catch things like SIGINT while reconnecting
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
if (currentJob.stdinStream) {
|
|
313
|
+
process.stdin.unpipe(currentJob.stdinStream);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
process.stdin.pipe(_socket2.default.createStream());
|
|
317
|
+
currentJob.stdoutStream = _socket2.default.createStream();
|
|
318
|
+
bindStreamEvents({
|
|
319
|
+
subShellRl,
|
|
320
|
+
isSubShell,
|
|
321
|
+
commonTrackingParams,
|
|
322
|
+
stdoutStream: currentJob.stdoutStream
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
|
|
230
327
|
(0, _command.default)({
|
|
231
328
|
wildcardCommand: true,
|
|
232
329
|
appContext: true,
|
|
@@ -381,7 +478,19 @@ const launchCommandAndGetStreams = async ({
|
|
|
381
478
|
});
|
|
382
479
|
}
|
|
383
480
|
|
|
481
|
+
const token = await _token.default.get();
|
|
482
|
+
const socket = (0, _socket.default)(`${_api.API_HOST}/wp-cli`, {
|
|
483
|
+
transportOptions: {
|
|
484
|
+
polling: {
|
|
485
|
+
extraHeaders: {
|
|
486
|
+
Authorization: `Bearer ${token.raw}`
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
agent: (0, _socksProxyAgent.default)()
|
|
491
|
+
});
|
|
384
492
|
currentJob = await launchCommandAndGetStreams({
|
|
493
|
+
socket,
|
|
385
494
|
guid: cliCommand.guid,
|
|
386
495
|
inputToken: inputToken
|
|
387
496
|
});
|
|
@@ -396,47 +505,12 @@ const launchCommandAndGetStreams = async ({
|
|
|
396
505
|
isSubShell,
|
|
397
506
|
stdoutStream: currentJob.stdoutStream
|
|
398
507
|
});
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
(0, _tracker.trackEvent)('wpcli_command_reconnect', commonTrackingParams);
|
|
406
|
-
currentJob = await launchCommandAndGetStreams({
|
|
407
|
-
guid: cliCommand.guid,
|
|
408
|
-
inputToken: inputToken,
|
|
409
|
-
offset: currentOffset
|
|
410
|
-
}); // Rebind new streams
|
|
411
|
-
|
|
412
|
-
pipeStreamsToProcess({
|
|
413
|
-
stdin: currentJob.stdinStream,
|
|
414
|
-
stdout: currentJob.stdoutStream
|
|
415
|
-
});
|
|
416
|
-
bindStreamEvents({
|
|
417
|
-
subShellRl,
|
|
418
|
-
isSubShell,
|
|
419
|
-
commonTrackingParams,
|
|
420
|
-
stdoutStream: currentJob.stdoutStream
|
|
421
|
-
}); // Resume readline interface
|
|
422
|
-
|
|
423
|
-
subShellRl.resume();
|
|
424
|
-
});
|
|
425
|
-
currentJob.socket.io.on('reconnect_attempt', () => {
|
|
426
|
-
// create a new input stream so that we can still catch things like SIGINT while reconnectin
|
|
427
|
-
if (currentJob.stdinStream) {
|
|
428
|
-
process.stdin.unpipe(currentJob.stdinStream);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
process.stdin.pipe(_socket2.default.createStream());
|
|
432
|
-
currentJob.stdoutStream = _socket2.default.createStream();
|
|
433
|
-
bindStreamEvents({
|
|
434
|
-
subShellRl,
|
|
435
|
-
isSubShell,
|
|
436
|
-
commonTrackingParams,
|
|
437
|
-
stdoutStream: currentJob.stdoutStream
|
|
438
|
-
});
|
|
439
|
-
console.error('There was an error connecting to the server. Retrying...');
|
|
508
|
+
bindReconnectEvents({
|
|
509
|
+
cliCommand,
|
|
510
|
+
inputToken,
|
|
511
|
+
subShellRl,
|
|
512
|
+
commonTrackingParams,
|
|
513
|
+
isSubShell
|
|
440
514
|
});
|
|
441
515
|
}); // Fix to re-add the \n character that readline strips when terminal == true
|
|
442
516
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = exports.DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = exports.DEV_ENVIRONMENT_RAW_GITHUB_HOST = exports.DEV_ENVIRONMENT_COMPONENTS = exports.DEV_ENVIRONMENT_NOT_FOUND = exports.DEV_ENVIRONMENT_PROMPT_INTRO = exports.DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_FULL_COMMAND = exports.DEV_ENVIRONMENT_SUBCOMMAND = void 0;
|
|
6
|
+
exports.DEV_ENVIRONMENT_PHP_VERSIONS = exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = exports.DEV_ENVIRONMENT_WORDPRESS_VERSIONS_URI = exports.DEV_ENVIRONMENT_RAW_GITHUB_HOST = exports.DEV_ENVIRONMENT_COMPONENTS = exports.DEV_ENVIRONMENT_NOT_FOUND = exports.DEV_ENVIRONMENT_PROMPT_INTRO = exports.DEV_ENVIRONMENT_DEFAULTS = exports.DEV_ENVIRONMENT_FULL_COMMAND = exports.DEV_ENVIRONMENT_SUBCOMMAND = void 0;
|
|
7
7
|
const DEV_ENVIRONMENT_SUBCOMMAND = 'dev-env';
|
|
8
8
|
exports.DEV_ENVIRONMENT_SUBCOMMAND = DEV_ENVIRONMENT_SUBCOMMAND;
|
|
9
9
|
const DEV_ENVIRONMENT_FULL_COMMAND = `vip ${DEV_ENVIRONMENT_SUBCOMMAND}`;
|
|
@@ -12,7 +12,8 @@ const DEV_ENVIRONMENT_DEFAULTS = {
|
|
|
12
12
|
title: 'VIP Dev',
|
|
13
13
|
multisite: false,
|
|
14
14
|
elasticsearchVersion: '7.10.1',
|
|
15
|
-
mariadbVersion: '10.3'
|
|
15
|
+
mariadbVersion: '10.3',
|
|
16
|
+
phpImage: 'default'
|
|
16
17
|
};
|
|
17
18
|
exports.DEV_ENVIRONMENT_DEFAULTS = DEV_ENVIRONMENT_DEFAULTS;
|
|
18
19
|
const DEV_ENVIRONMENT_PROMPT_INTRO = 'This is a wizard to help you set up your local dev environment.\n\n' + 'Sensible default values were pre-selected for convenience. ' + 'You may also choose to create multiple environments with different settings using the --slug option.\n\n';
|
|
@@ -29,4 +30,13 @@ const DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = 'wordpress-versions.json';
|
|
|
29
30
|
exports.DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY = DEV_ENVIRONMENT_WORDPRESS_CACHE_KEY;
|
|
30
31
|
const DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = 86400; // once per day
|
|
31
32
|
|
|
32
|
-
exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL;
|
|
33
|
+
exports.DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL = DEV_ENVIRONMENT_WORDPRESS_VERSION_TTL;
|
|
34
|
+
const DEV_ENVIRONMENT_PHP_VERSIONS = {
|
|
35
|
+
default: 'ghcr.io/automattic/vip-container-images/php-fpm:7.4',
|
|
36
|
+
// eslint-disable-next-line quote-props -- flow does nit support non-string keys
|
|
37
|
+
'7.4': 'ghcr.io/automattic/vip-container-images/php-fpm-alt:7.4',
|
|
38
|
+
'8.0': 'ghcr.io/automattic/vip-container-images/php-fpm-alt:8.0',
|
|
39
|
+
// eslint-disable-next-line quote-props
|
|
40
|
+
'8.1': 'ghcr.io/automattic/vip-container-images/php-fpm-alt:8.1'
|
|
41
|
+
};
|
|
42
|
+
exports.DEV_ENVIRONMENT_PHP_VERSIONS = DEV_ENVIRONMENT_PHP_VERSIONS;
|
|
@@ -13,6 +13,7 @@ exports.promptForArguments = promptForArguments;
|
|
|
13
13
|
exports.resolvePath = resolvePath;
|
|
14
14
|
exports.promptForText = promptForText;
|
|
15
15
|
exports.promptForBoolean = promptForBoolean;
|
|
16
|
+
exports.promptForPhpVersion = promptForPhpVersion;
|
|
16
17
|
exports.promptForComponent = promptForComponent;
|
|
17
18
|
exports.addDevEnvConfigurationOptions = addDevEnvConfigurationOptions;
|
|
18
19
|
exports.getTagChoices = getTagChoices;
|
|
@@ -67,9 +68,9 @@ function handleCLIException(exception) {
|
|
|
67
68
|
console.log(errorPrefix, message);
|
|
68
69
|
|
|
69
70
|
if (!process.env.DEBUG) {
|
|
70
|
-
console.log(`Please re-run the command with "${_chalk.default.bold('
|
|
71
|
+
console.log(`Please re-run the command with "--debug ${_chalk.default.bold('@automattic/vip:bin:dev-environment')}" appended to it and provide the stack trace on the support ticket.`);
|
|
71
72
|
console.log(_chalk.default.bold('\nExample:\n'));
|
|
72
|
-
console.log('
|
|
73
|
+
console.log('vip dev-env create --debug @automattic/vip:bin:dev-environment \n');
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
debug(exception);
|
|
@@ -166,6 +167,7 @@ async function promptForArguments(preselectedOptions, defaultOptions) {
|
|
|
166
167
|
wpTitle: preselectedOptions.title || (await promptForText('WordPress site title', defaultOptions.title || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.title)),
|
|
167
168
|
multisite: 'multisite' in preselectedOptions ? preselectedOptions.multisite : await promptForBoolean(multisiteText, !!multisiteDefault),
|
|
168
169
|
elasticsearch: preselectedOptions.elasticsearch || defaultOptions.elasticsearch || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.elasticsearchVersion,
|
|
170
|
+
php: preselectedOptions.php ? resolvePhpVersion(preselectedOptions.php) : await promptForPhpVersion(resolvePhpVersion(defaultOptions.php || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.phpVersion)),
|
|
169
171
|
mariadb: preselectedOptions.mariadb || defaultOptions.mariadb || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.mariadbVersion,
|
|
170
172
|
mediaRedirectDomain: preselectedOptions.mediaRedirectDomain || '',
|
|
171
173
|
wordpress: {
|
|
@@ -180,7 +182,12 @@ async function promptForArguments(preselectedOptions, defaultOptions) {
|
|
|
180
182
|
statsd: false,
|
|
181
183
|
phpmyadmin: false,
|
|
182
184
|
xdebug: false,
|
|
183
|
-
siteSlug: ''
|
|
185
|
+
siteSlug: '',
|
|
186
|
+
enterpriseSearchEnabled: preselectedOptions.enterpriseSearchEnabled || defaultOptions.enterpriseSearchEnabled
|
|
187
|
+
};
|
|
188
|
+
const promptLabels = {
|
|
189
|
+
xdebug: 'XDebug',
|
|
190
|
+
phpmyadmin: 'phpMyAdmin'
|
|
184
191
|
};
|
|
185
192
|
|
|
186
193
|
if (!instanceData.mediaRedirectDomain && defaultOptions.mediaRedirectDomain) {
|
|
@@ -208,11 +215,17 @@ async function promptForArguments(preselectedOptions, defaultOptions) {
|
|
|
208
215
|
instanceData[component] = result;
|
|
209
216
|
}
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
218
|
+
instanceData.enterpriseSearchEnabled = await promptForBoolean('Enable Enterprise Search?', defaultOptions.enterpriseSearchEnabled);
|
|
219
|
+
|
|
220
|
+
if (instanceData.enterpriseSearchEnabled) {
|
|
221
|
+
instanceData.statsd = preselectedOptions.statsd || defaultOptions.statsd || false;
|
|
222
|
+
} else {
|
|
223
|
+
instanceData.statsd = false;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
for (const service of ['phpmyadmin', 'xdebug']) {
|
|
227
|
+
if (service in instanceData) {
|
|
228
|
+
instanceData[service] = await promptForBoolean(`Enable ${promptLabels[service] || service}`, instanceData[service]);
|
|
216
229
|
}
|
|
217
230
|
}
|
|
218
231
|
|
|
@@ -288,6 +301,35 @@ async function promptForBoolean(message, initial) {
|
|
|
288
301
|
return confirm.run();
|
|
289
302
|
}
|
|
290
303
|
|
|
304
|
+
function resolvePhpVersion(version) {
|
|
305
|
+
debug(`Resolving PHP version '${version}'`);
|
|
306
|
+
const versions = Object.keys(_devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS);
|
|
307
|
+
const images = Object.values(_devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS); // eslint-disable-next-line eqeqeq -- use loose comparison because commander resolves '8.0' to '8'
|
|
308
|
+
|
|
309
|
+
const index = versions.findIndex(value => value == version);
|
|
310
|
+
|
|
311
|
+
if (index === -1) {
|
|
312
|
+
const image = images.find(value => value === version);
|
|
313
|
+
return image !== null && image !== void 0 ? image : images[0];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return images[index];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
async function promptForPhpVersion(initialValue) {
|
|
320
|
+
debug(`Prompting for PHP version, preselected option is ${initialValue}`);
|
|
321
|
+
const choices = Object.keys(_devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS);
|
|
322
|
+
const images = Object.values(_devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS);
|
|
323
|
+
const initial = images.findIndex(version => version === initialValue);
|
|
324
|
+
const select = new _enquirer.Select({
|
|
325
|
+
message: 'PHP version to use',
|
|
326
|
+
choices,
|
|
327
|
+
initial
|
|
328
|
+
});
|
|
329
|
+
const answer = await select.run();
|
|
330
|
+
return resolvePhpVersion(answer);
|
|
331
|
+
}
|
|
332
|
+
|
|
291
333
|
const componentDisplayNames = {
|
|
292
334
|
wordpress: 'WordPress',
|
|
293
335
|
muPlugins: 'vip-go-mu-plugins',
|
|
@@ -346,47 +388,15 @@ async function promptForComponent(component, allowLocal, defaultObject) {
|
|
|
346
388
|
|
|
347
389
|
if (component === 'wordpress') {
|
|
348
390
|
const message = `${messagePrefix}Which version would you like`;
|
|
349
|
-
const tagChoices = await getTagChoices();
|
|
350
|
-
// This strips the whitespace for matching to the defaultObject.tag
|
|
351
|
-
|
|
352
|
-
const formatted = tagChoices.map(elm => {
|
|
353
|
-
return elm.trim();
|
|
354
|
-
}); // First tag not: "Pre-Release"
|
|
355
|
-
|
|
356
|
-
const firstNonPreRelease = formatted.find(img => {
|
|
357
|
-
return !img.match(/Pre\-Release/g);
|
|
358
|
-
}); // Set initialTagIndex as the first non Pre-Release
|
|
359
|
-
|
|
360
|
-
let initialTagIndex = formatted.indexOf(firstNonPreRelease);
|
|
361
|
-
|
|
362
|
-
if (defaultObject !== null && defaultObject !== void 0 && defaultObject.tag) {
|
|
363
|
-
const defaultTagIndex = formatted.indexOf(defaultObject.tag);
|
|
364
|
-
|
|
365
|
-
if (defaultTagIndex !== -1) {
|
|
366
|
-
initialTagIndex = defaultTagIndex;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
391
|
+
const tagChoices = await getTagChoices();
|
|
370
392
|
const selectTag = new _enquirer.Select({
|
|
371
393
|
message,
|
|
372
|
-
choices:
|
|
373
|
-
initial: initialTagIndex
|
|
394
|
+
choices: tagChoices
|
|
374
395
|
});
|
|
375
|
-
const option = await selectTag.run();
|
|
376
|
-
// Some of the options are like: '5.7 → 5.7.5'
|
|
377
|
-
// Extract first occurrence of something that looks like a tag
|
|
378
|
-
|
|
379
|
-
const tagRgx = new RegExp(/(\d+\.\d+(?:\.\d+)?)/);
|
|
380
|
-
const match = tagRgx.exec(option);
|
|
381
|
-
|
|
382
|
-
if (!Array.isArray(match) || match.length < 2) {
|
|
383
|
-
throw new Error(`Invalid WordPress selection: ${option}`);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
const tag = match[1];
|
|
396
|
+
const option = await selectTag.run();
|
|
387
397
|
return {
|
|
388
398
|
mode: modeResult,
|
|
389
|
-
tag
|
|
399
|
+
tag: option
|
|
390
400
|
};
|
|
391
401
|
} // image
|
|
392
402
|
|
|
@@ -409,7 +419,7 @@ function addDevEnvConfigurationOptions(command) {
|
|
|
409
419
|
var _value$toLowerCase3;
|
|
410
420
|
|
|
411
421
|
return 'false' !== (value === null || value === void 0 ? void 0 : (_value$toLowerCase3 = value.toLowerCase) === null || _value$toLowerCase3 === void 0 ? void 0 : _value$toLowerCase3.call(value));
|
|
412
|
-
}).option('elasticsearch', 'Explicitly choose Elasticsearch version to use').option('mariadb', 'Explicitly choose MariaDB version to use').option(['r', 'media-redirect-domain'], 'Domain to redirect for missing media files. This can be used to still have images without the need to import them locally.');
|
|
422
|
+
}).option('elasticsearch', 'Explicitly choose Elasticsearch version to use').option('mariadb', 'Explicitly choose MariaDB version to use').option(['r', 'media-redirect-domain'], 'Domain to redirect for missing media files. This can be used to still have images without the need to import them locally.').option('php', 'Explicitly choose PHP version to use');
|
|
413
423
|
}
|
|
414
424
|
/**
|
|
415
425
|
* Provides the list of tag choices for selection
|
|
@@ -417,17 +427,16 @@ function addDevEnvConfigurationOptions(command) {
|
|
|
417
427
|
|
|
418
428
|
|
|
419
429
|
async function getTagChoices() {
|
|
420
|
-
const tagChoices = [];
|
|
421
|
-
let tagFormatted, prerelease, mapping;
|
|
422
430
|
const versions = await (0, _devEnvironmentCore.getVersionList)();
|
|
423
431
|
|
|
424
432
|
if (versions.length < 1) {
|
|
425
433
|
return ['5.9', '5.8', '5.7', '5.6', '5.5'];
|
|
426
434
|
}
|
|
427
435
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
436
|
+
return versions.map(version => {
|
|
437
|
+
let mapping;
|
|
438
|
+
const tagFormatted = version.tag.padEnd(8 - version.tag.length);
|
|
439
|
+
const prerelease = version.prerelease ? '(Pre-Release)' : '';
|
|
431
440
|
|
|
432
441
|
if (version.tag !== version.ref) {
|
|
433
442
|
mapping = `→ ${prerelease} ${version.ref}`;
|
|
@@ -435,8 +444,10 @@ async function getTagChoices() {
|
|
|
435
444
|
mapping = '';
|
|
436
445
|
}
|
|
437
446
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
447
|
+
return {
|
|
448
|
+
name: version.tag,
|
|
449
|
+
message: `${tagFormatted} ${mapping}`,
|
|
450
|
+
value: version.tag
|
|
451
|
+
};
|
|
452
|
+
});
|
|
442
453
|
}
|
|
@@ -154,6 +154,8 @@ function preProcessInstanceData(instanceData) {
|
|
|
154
154
|
newInstanceData.mediaRedirectDomain = `https://${instanceData.mediaRedirectDomain}`;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
newInstanceData.enterpriseSearchEnabled = instanceData.enterpriseSearchEnabled || false;
|
|
158
|
+
newInstanceData.php = instanceData.php || _devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS.default;
|
|
157
159
|
return newInstanceData;
|
|
158
160
|
}
|
|
159
161
|
|
|
@@ -473,7 +475,6 @@ async function importMediaPath(slug, filePath) {
|
|
|
473
475
|
|
|
474
476
|
async function updateWordPressImage(slug) {
|
|
475
477
|
const versions = await getVersionList();
|
|
476
|
-
const refRgx = new RegExp(/\d+\.\d+(?:\.\d+)?/);
|
|
477
478
|
let message, envData, currentWordPressTag; // Get the current environment configuration
|
|
478
479
|
|
|
479
480
|
try {
|
|
@@ -489,55 +490,65 @@ async function updateWordPressImage(slug) {
|
|
|
489
490
|
}
|
|
490
491
|
|
|
491
492
|
(0, _devEnvironmentCli.handleCLIException)(new Error(message));
|
|
492
|
-
|
|
493
|
-
|
|
493
|
+
return false;
|
|
494
|
+
} // sort
|
|
494
495
|
|
|
495
|
-
const filteredVersions = versions.filter(vsn => {
|
|
496
|
-
return refRgx.test(vsn.ref);
|
|
497
|
-
}); // sort
|
|
498
496
|
|
|
499
|
-
|
|
497
|
+
versions.sort((before, after) => before.tag < after.tag ? 1 : -1); // Newest WordPress Image
|
|
500
498
|
|
|
501
|
-
const newestWordPressImage =
|
|
499
|
+
const newestWordPressImage = versions[0];
|
|
502
500
|
console.log('The most recent WordPress version available is: ' + _chalk.default.green(newestWordPressImage.tag)); // If the currently used version is the most up to date: exit.
|
|
503
501
|
|
|
504
|
-
if (currentWordPressTag === newestWordPressImage.
|
|
502
|
+
if (currentWordPressTag === newestWordPressImage.tag) {
|
|
505
503
|
console.log('Environment WordPress version is: ' + _chalk.default.green(currentWordPressTag) + ' ... 😎 nice! ');
|
|
506
504
|
return false;
|
|
507
505
|
} // Determine if there is an image available for the current WordPress version
|
|
508
506
|
|
|
509
507
|
|
|
510
|
-
const match =
|
|
511
|
-
|
|
512
|
-
}) =>
|
|
508
|
+
const match = versions.find(({
|
|
509
|
+
tag
|
|
510
|
+
}) => tag === currentWordPressTag); // If there is no available image for the currently installed version, give user a path to change
|
|
513
511
|
|
|
514
512
|
if (typeof match === 'undefined') {
|
|
515
513
|
console.log(`Installed WordPress: ${currentWordPressTag} has no available container image in repository. `);
|
|
516
514
|
console.log('You must select a new WordPress image to continue... ');
|
|
517
515
|
} else {
|
|
518
|
-
console.log('Environment WordPress version is: ' + _chalk.default.yellow(match.ref));
|
|
516
|
+
console.log('Environment WordPress version is: ' + _chalk.default.yellow(`${match.tag} (${match.ref})`));
|
|
517
|
+
|
|
518
|
+
if (envData.wordpress.doNotUpgrade || false) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
519
521
|
} // Prompt the user to select a new WordPress Version
|
|
520
522
|
|
|
521
523
|
|
|
522
524
|
const confirm = await (0, _enquirer.prompt)({
|
|
523
|
-
type: '
|
|
525
|
+
type: 'select',
|
|
524
526
|
name: 'upgrade',
|
|
525
|
-
message: 'Would You like to change the WordPress version? '
|
|
527
|
+
message: 'Would You like to change the WordPress version? ',
|
|
528
|
+
choices: ['yes', 'no', "no (don't ask anymore)"]
|
|
526
529
|
}); // If the user takes the new WP version path
|
|
527
530
|
|
|
528
|
-
if (confirm.upgrade) {
|
|
531
|
+
if (confirm.upgrade === 'yes') {
|
|
529
532
|
console.log('Upgrading from: ' + _chalk.default.yellow(currentWordPressTag) + ' to:'); // Select a new image
|
|
530
533
|
|
|
531
534
|
const choice = await (0, _devEnvironmentCli.promptForComponent)('wordpress');
|
|
532
|
-
const version =
|
|
535
|
+
const version = versions.find(({
|
|
533
536
|
tag
|
|
534
537
|
}) => tag.trim() === choice.tag.trim()); // Write new data and stage for rebuild
|
|
535
538
|
|
|
536
539
|
envData.wordpress.tag = version.tag;
|
|
540
|
+
envData.wordpress.ref = version.ref;
|
|
537
541
|
await updateEnvironment(envData);
|
|
538
542
|
return true;
|
|
539
543
|
}
|
|
540
544
|
|
|
545
|
+
if (confirm.upgrade === "no (don't ask anymore)") {
|
|
546
|
+
envData.wordpress.doNotUpgrade = true;
|
|
547
|
+
console.log("We won't ask about upgrading this environment anymore.");
|
|
548
|
+
console.log('To manually upgrade please run:' + `${_chalk.default.yellow(`vip dev-env update --slug=${slug}`)}`);
|
|
549
|
+
await updateEnvironment(envData);
|
|
550
|
+
}
|
|
551
|
+
|
|
541
552
|
return false;
|
|
542
553
|
}
|
|
543
554
|
/**
|
package/npm-shrinkwrap.json
CHANGED