Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@alicloud/fc2": "^2.6.6",
"@alicloud/fc20230330": "4.3.4",
"@alicloud/pop-core": "^1.8.0",
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.21",
"@serverless-cd/srm-aliyun-pop-core": "^0.0.8-beta.1",
"@serverless-cd/srm-aliyun-ram20150501": "^0.0.2-beta.9",
"@serverless-cd/srm-aliyun-sls20201230": "0.0.5-beta.3",
"@serverless-devs/diff": "^0.0.3-beta.6",
Expand Down
42 changes: 26 additions & 16 deletions src/resources/fc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,20 @@ export default class FC extends FC_Client {
throw ex;
}
retry += 1;

logger.spin(
'retrying',
'function',
needUpdate ? 'update' : 'create',
`${this.region}/${config.functionName}`,
retry,
);
if (isAppCenter()) {
const action = needUpdate ? 'update' : 'create';
logger.info(
`retrying ${action} function ${this.region}/${config.functionName} ${retry} times`,
);
} else {
logger.spin(
'retrying',
'function',
needUpdate ? 'update' : 'create',
`${this.region}/${config.functionName}`,
retry,
);
}
await sleep(retryTime);
}
}
Expand Down Expand Up @@ -364,14 +370,18 @@ export default class FC extends FC_Client {
throw ex;
}
retry += 1;

logger.spin(
'retrying',
'trigger',
needUpdate ? 'update' : 'create',
`${this.region}/${id}`,
retry,
);
if (isAppCenter()) {
const action = needUpdate ? 'update' : 'create';
logger.info(`retrying ${action} trigger ${this.region}/${id} ${retry} times`);
} else {
logger.spin(
'retrying',
'trigger',
needUpdate ? 'update' : 'create',
`${this.region}/${id}`,
retry,
);
}

await sleep(3);
}
Expand Down
32 changes: 21 additions & 11 deletions src/resources/sls/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IRegion } from '../../interface';
import { PROJECT, LOG_STORE } from '../../default/resources';
import logger from '../../logger';
import getUuid from 'uuid-by-string';
import { isAppCenter } from '../../utils/index';

export default class Sls {
static generateProjectName = (region: IRegion, accountID: string): string => {
Expand Down Expand Up @@ -51,18 +52,27 @@ export default class Sls {
});

logger.debug(`init sls: ${JSON.stringify(request)}`);

logger.spin(
'creating',
'sls',
`region: ${this.region}; project: ${project}; logstore: ${logstore}`,
);
if (isAppCenter()) {
logger.info(
`creating sls region: ${this.region}; project: ${project}; logstore: ${logstore}`,
);
} else {
logger.spin(
'creating',
'sls',
`region: ${this.region}; project: ${project}; logstore: ${logstore}`,
);
}
await this.client.initSls(request);
logger.spin(
'created',
'sls',
`region: ${this.region}; project: ${project}; logstore: ${logstore}`,
);
if (isAppCenter()) {
logger.info(`created sls region: ${this.region}; project: ${project}; logstore: ${logstore}`);
} else {
logger.spin(
'created',
'sls',
`region: ${this.region}; project: ${project}; logstore: ${logstore}`,
);
}
return { project, logstore };
}
}
4 changes: 2 additions & 2 deletions src/subCommands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default class Deploy {

constructor(readonly inputs: IInputs) {
if (isAppCenter()) {
logger.info(`input: ${JSON.stringify(inputs)}`);
logger.info(`input props: ${JSON.stringify(inputs.props)}`);
} else {
logger.debug(`input: ${JSON.stringify(inputs)}`);
logger.debug(`input props: ${JSON.stringify(inputs.props)}`);
}
this.opts = parseArgv(inputs.args, {
alias: {
Expand Down
Loading