@solidactions/cli 1.10.0 → 1.10.2
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/commands/deploy.js
CHANGED
|
@@ -242,15 +242,23 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
242
242
|
process.exit(1);
|
|
243
243
|
}
|
|
244
244
|
console.log(chalk_1.default.yellow(`Project "${projectName}"${envLabel} not found. Creating...`));
|
|
245
|
+
const requestedSlug = projectName.toLowerCase().replace(/[^a-z0-9-]/g, '-') + (environment !== 'production' ? `-${environment}` : '');
|
|
245
246
|
try {
|
|
246
247
|
const createResponse = await axios_1.default.post(`${config.host}/api/v1/projects`, {
|
|
247
248
|
name: projectName,
|
|
248
|
-
slug:
|
|
249
|
+
slug: requestedSlug,
|
|
249
250
|
environment: environment,
|
|
250
251
|
}, {
|
|
251
252
|
headers: (0, api_1.getApiHeaders)(config, 'application/json'),
|
|
252
253
|
});
|
|
253
|
-
|
|
254
|
+
// Fallback chain: prefer the server-echoed slug; if absent, use the slug we
|
|
255
|
+
// *requested* in the POST body (server stored that value). Falling back to
|
|
256
|
+
// `name` strips the env suffix and causes the polling GET to 404 with
|
|
257
|
+
// "Project 'X' not found in your active workspace 'Y'.".
|
|
258
|
+
projectSlug = createResponse.data.slug || requestedSlug;
|
|
259
|
+
if (process.env.SOLIDACTIONS_DEPLOY_DEBUG === '1') {
|
|
260
|
+
process.stderr.write(`[deploy-debug] requestedSlug=${requestedSlug} responseSlug=${createResponse.data.slug ?? '(missing)'} responseName=${createResponse.data.name ?? '(missing)'} resolvedSlug=${projectSlug}\n`);
|
|
261
|
+
}
|
|
254
262
|
console.log(chalk_1.default.green(`Project "${projectName}"${envLabel} created.`));
|
|
255
263
|
}
|
|
256
264
|
catch (createError) {
|
|
@@ -282,6 +290,9 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
282
290
|
const form = new form_data_1.default();
|
|
283
291
|
form.append('source', fs_1.default.createReadStream(archivePath));
|
|
284
292
|
console.log(chalk_1.default.yellow('Uploading...'));
|
|
293
|
+
if (process.env.SOLIDACTIONS_DEPLOY_DEBUG === '1') {
|
|
294
|
+
process.stderr.write(`[deploy-debug] POST ${config.host}/api/v1/projects/${projectSlug}/deploy (workspace=${config.workspaceId ?? '(none)'})\n`);
|
|
295
|
+
}
|
|
285
296
|
await axios_1.default.post(`${config.host}/api/v1/projects/${projectSlug}/deploy`, form, {
|
|
286
297
|
headers: {
|
|
287
298
|
...form.getHeaders(),
|
|
@@ -292,6 +303,9 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
292
303
|
});
|
|
293
304
|
console.log(chalk_1.default.green('Deployment successfully queued!'));
|
|
294
305
|
console.log(chalk_1.default.yellow('Waiting for build to complete...\n'));
|
|
306
|
+
if (process.env.SOLIDACTIONS_DEPLOY_DEBUG === '1') {
|
|
307
|
+
process.stderr.write(`[deploy-debug] poll URL = ${config.host}/api/v1/projects/${projectSlug} (workspace=${config.workspaceId ?? '(none)'})\n`);
|
|
308
|
+
}
|
|
295
309
|
// Poll for completion
|
|
296
310
|
let attempts = 0;
|
|
297
311
|
const maxAttempts = 600; // 10 minutes of inactivity timeout
|
|
@@ -146,7 +146,7 @@ function indent(text, prefix = ' ') {
|
|
|
146
146
|
/**
|
|
147
147
|
* Defense-in-depth: even though the SAA API sanitizes `Authorization`,
|
|
148
148
|
* `x-pica-*`, and `x-one-*` out of `ioExample.input.headers` before serving,
|
|
149
|
-
* filter them again here so any future drift can't leak
|
|
149
|
+
* filter them again here so any future drift can't leak proxy internals into
|
|
150
150
|
* a workflow's outbound request.
|
|
151
151
|
*/
|
|
152
152
|
function isProxyManagedHeader(name) {
|