1
1
const inquirer = require("inquirer");
2
2
const JSONbig = require("json-bigint")({ storeAsString: false });
3
3
const { Command } = require("commander");
4
- const { localConfig } = require("../config");
4
+ const { localConfig, globalConfig } = require("../config");
5
5
const { Spinner, SPINNER_ARC, SPINNER_DOTS } = require('../spinner');
6
6
const { paginate } = require('../paginate');
7
7
const { questionsPushBuckets, questionsPushTeams, questionsPushFunctions, questionsGetEntrypoint, questionsPushCollections, questionsConfirmPushCollections } = require("../questions");
@@ -314,6 +314,7 @@ const pushFunction = async ({ functionId, all, yes } = {}) => {
314
314
Spinner.start(false);
315
315
let successfullyPushed = 0;
316
316
let successfullyDeployed = 0;
317
+ const failedDeployments = [];
317
318
318
319
await Promise.all(functions.map(async (func) => {
319
320
const ignore = func.ignore ? 'appwrite.json' : '.gitignore';
@@ -479,7 +480,8 @@ const pushFunction = async ({ functionId, all, yes } = {}) => {
479
480
480
481
break;
481
482
} else if (status === 'failed') {
482
- updaterRow.fail({ errorMessage: 'Failed to deploy.' });
483
+ failedDeployments.push({ name: func['name'], $id: func['$id'], deployment: response['$id'] });
484
+ updaterRow.fail({ errorMessage: `Failed to deploy` });
483
485
484
486
break;
485
487
} else {
@@ -498,6 +500,14 @@ const pushFunction = async ({ functionId, all, yes } = {}) => {
498
500
}));
499
501
500
502
Spinner.stop();
503
+ console.log('\n');
504
+
505
+ failedDeployments.forEach((failed) => {
506
+ const { name, deployment, $id } = failed;
507
+ const failUrl = `${globalConfig.getEndpoint().replace('/v1', '')}/console/project-${localConfig.getProject().projectId}/functions/function-${$id}/deployment-${deployment}`;
508
+
509
+ error(`Deployment of ${name} has failed. Check at ${failUrl} for more details\n`);
510
+ })
501
511
502
512
success(`Pushed ${successfullyPushed} functions with ${successfullyDeployed} successfully deployed`);
503
513
}
0 commit comments