@automattic/vip 2.38.0-dev.2 → 2.38.1
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/dist/bin/vip-app-deploy.js +2 -2
- package/dist/bin/vip-db-phpmyadmin.js +0 -5
- package/dist/commands/export-sql.js +7 -3
- package/dist/commands/phpmyadmin.js +3 -0
- package/dist/lib/backup-storage-availability/backup-storage-availability.js +29 -6
- package/dist/lib/cli/progress.js +11 -3
- package/dist/lib/dev-environment/docker-utils.js +2 -1
- package/npm-shrinkwrap.json +199 -199
- package/package.json +6 -6
- package/schema.gql +0 -20174
|
@@ -50,8 +50,8 @@ const appQuery = `
|
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
52
|
const START_DEPLOY_MUTATION = (0, _graphqlTag.default)`
|
|
53
|
-
mutation
|
|
54
|
-
|
|
53
|
+
mutation StartCustomDeploy($input: AppEnvironmentCustomDeployInput) {
|
|
54
|
+
startCustomDeploy(input: $input) {
|
|
55
55
|
app {
|
|
56
56
|
id
|
|
57
57
|
name
|
|
@@ -393,9 +393,13 @@ class ExportSQLCommand {
|
|
|
393
393
|
this.progressTracker.stepSuccess(this.steps.PREPARE);
|
|
394
394
|
await (0, _utils.pollUntil)(this.getExportJob.bind(this), EXPORT_SQL_PROGRESS_POLL_INTERVAL, this.isCreated.bind(this));
|
|
395
395
|
this.progressTracker.stepSuccess(this.steps.CREATE);
|
|
396
|
-
const storageConfirmed = await this.progressTracker.handleContinuePrompt(async
|
|
397
|
-
|
|
398
|
-
|
|
396
|
+
const storageConfirmed = await this.progressTracker.handleContinuePrompt(async setPromptShown => {
|
|
397
|
+
const status = await this.confirmEnoughStorage(await this.getExportJob());
|
|
398
|
+
if (status.isPromptShown) {
|
|
399
|
+
setPromptShown();
|
|
400
|
+
}
|
|
401
|
+
return status.continue;
|
|
402
|
+
});
|
|
399
403
|
if (storageConfirmed) {
|
|
400
404
|
this.progressTracker.stepSuccess(this.steps.CONFIRM_ENOUGH_STORAGE);
|
|
401
405
|
} else {
|
|
@@ -183,6 +183,9 @@ class PhpMyAdminCommand {
|
|
|
183
183
|
stack: error.stack
|
|
184
184
|
});
|
|
185
185
|
this.stopProgressTracker();
|
|
186
|
+
if (error.graphQLErrors?.find(e => e.message === 'Unauthorized')) {
|
|
187
|
+
exit.withError('You do not have sufficient permission to access phpMyAdmin for this environment.');
|
|
188
|
+
}
|
|
186
189
|
exit.withError('Failed to enable PhpMyAdmin. Please try again. If the problem persists, please contact support.');
|
|
187
190
|
}
|
|
188
191
|
let url;
|
|
@@ -77,14 +77,23 @@ class BackupStorageAvailability {
|
|
|
77
77
|
const confirmPrompt = new _enquirer.Confirm({
|
|
78
78
|
message: `We recommend that you have at least ${this.bytesToHuman(storageRequired)} of free space in your machine to download this database backup. Do you still want to continue with downloading the database backup?`
|
|
79
79
|
});
|
|
80
|
-
return
|
|
80
|
+
return {
|
|
81
|
+
continue: await confirmPrompt.run(),
|
|
82
|
+
isPromptShown: true
|
|
83
|
+
};
|
|
81
84
|
}
|
|
82
|
-
return
|
|
85
|
+
return {
|
|
86
|
+
continue: true,
|
|
87
|
+
isPromptShown: false
|
|
88
|
+
};
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
// eslint-disable-next-line id-length
|
|
86
92
|
async validateAndPromptDiskSpaceWarningForDevEnvBackupImport() {
|
|
87
93
|
let storageAvailableInMainMachinePrompted = false;
|
|
94
|
+
|
|
95
|
+
// there's two prompts, so as long as one prompt is shown, we need to set isPromptShown
|
|
96
|
+
let isPromptShown = false;
|
|
88
97
|
if (!(await this.isStorageAvailableInMainMachine())) {
|
|
89
98
|
const storageRequired = this.getStorageRequiredInMainMachine();
|
|
90
99
|
const storageAvailableInVipPath = this.bytesToHuman(await this.getStorageAvailableInVipPath());
|
|
@@ -93,9 +102,13 @@ class BackupStorageAvailability {
|
|
|
93
102
|
Do you still want to continue with importing the database backup?
|
|
94
103
|
`
|
|
95
104
|
});
|
|
105
|
+
isPromptShown = true;
|
|
96
106
|
storageAvailableInMainMachinePrompted = await confirmPrompt.run();
|
|
97
107
|
if (!storageAvailableInMainMachinePrompted) {
|
|
98
|
-
return
|
|
108
|
+
return {
|
|
109
|
+
continue: false,
|
|
110
|
+
isPromptShown
|
|
111
|
+
};
|
|
99
112
|
}
|
|
100
113
|
}
|
|
101
114
|
try {
|
|
@@ -106,16 +119,26 @@ Do you still want to continue with importing the database backup?
|
|
|
106
119
|
message: `We recommend that you have at least ${this.bytesToHuman(storageRequired)} of free space in your Docker machine to import this database backup. We estimate that you currently have ${storageAvailableInDockerMachine} of space in your machine.
|
|
107
120
|
Do you still want to continue with importing the database backup?`
|
|
108
121
|
});
|
|
109
|
-
|
|
122
|
+
isPromptShown = true;
|
|
123
|
+
return {
|
|
124
|
+
continue: await confirmPrompt.run(),
|
|
125
|
+
isPromptShown
|
|
126
|
+
};
|
|
110
127
|
}
|
|
111
128
|
} catch (error) {
|
|
112
129
|
if (error instanceof _dockerMachineNotFoundError.DockerMachineNotFoundError) {
|
|
113
130
|
// skip storage available check
|
|
114
|
-
return
|
|
131
|
+
return {
|
|
132
|
+
continue: true,
|
|
133
|
+
isPromptShown
|
|
134
|
+
};
|
|
115
135
|
}
|
|
116
136
|
throw error;
|
|
117
137
|
}
|
|
118
|
-
return
|
|
138
|
+
return {
|
|
139
|
+
continue: true,
|
|
140
|
+
isPromptShown
|
|
141
|
+
};
|
|
119
142
|
}
|
|
120
143
|
}
|
|
121
144
|
exports.BackupStorageAvailability = BackupStorageAvailability;
|
package/dist/lib/cli/progress.js
CHANGED
|
@@ -181,8 +181,14 @@ class ProgressTracker {
|
|
|
181
181
|
async handleContinuePrompt(prompt) {
|
|
182
182
|
this.print();
|
|
183
183
|
this.stopPrinting();
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
let isPromptShown = false;
|
|
185
|
+
const setPromptShown = () => {
|
|
186
|
+
isPromptShown = true;
|
|
187
|
+
};
|
|
188
|
+
const returnValue = await prompt(setPromptShown);
|
|
189
|
+
if (isPromptShown) {
|
|
190
|
+
this.displayFromStep = [...this.getSteps().values()].findIndex(step => step.status === StepStatus.RUNNING);
|
|
191
|
+
}
|
|
186
192
|
let hasPrintedOnce = false;
|
|
187
193
|
const printingStartedPromise = new Promise(resolve => {
|
|
188
194
|
this.startPrinting(() => {
|
|
@@ -196,7 +202,9 @@ class ProgressTracker {
|
|
|
196
202
|
for (let iteration = 0; iteration < this.stepsFromCaller.size; iteration++) {
|
|
197
203
|
linesToSkip += _nodeOs.EOL;
|
|
198
204
|
}
|
|
199
|
-
|
|
205
|
+
if (isPromptShown) {
|
|
206
|
+
process.stdout.write(linesToSkip);
|
|
207
|
+
}
|
|
200
208
|
hasPrintedOnce = true;
|
|
201
209
|
resolve();
|
|
202
210
|
});
|
|
@@ -60,8 +60,9 @@ async function getDockerSocket() {
|
|
|
60
60
|
|
|
61
61
|
// Try the default location
|
|
62
62
|
paths.push('/var/run/docker.sock');
|
|
63
|
-
// Try
|
|
63
|
+
// Try alternative locations
|
|
64
64
|
paths.push((0, _nodePath.join)((0, _nodeOs.homedir)(), '.docker', 'run', 'docker.sock'));
|
|
65
|
+
paths.push((0, _nodePath.join)((0, _nodeOs.homedir)(), '.orbstack', 'run', 'docker.sock'));
|
|
65
66
|
for (const socketPath of paths) {
|
|
66
67
|
try {
|
|
67
68
|
const stats = await (0, _promises.stat)(socketPath);
|