@cloudbase/manager-node 5.6.1 → 5.6.3
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/CHANGELOG.md +14 -0
- package/lib/cloudrun/index.js +40 -29
- package/lib/function/index.js +2 -2
- package/package.json +1 -1
- package/types/cloudrun/index.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## @cloudbase/manager-node v5.6.2 版本发布 🚀(2026-07-09)
|
|
2
|
+
|
|
3
|
+
- 新增 支持镜像部署模式
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## @cloudbase/manager-node v5.6.1 版本发布 🚀(2026-07-09)
|
|
8
|
+
|
|
9
|
+
- 新增 内置 AES-256-CBC 加解密能力,支持明文 envVariables 自动加密
|
|
10
|
+
- 新增 cloudrunparams0706
|
|
11
|
+
- 修复 AppId 优先从 UserInfo 获取,不再强依赖存储服务
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
## @cloudbase/manager-node v5.6.0 版本发布 🚀(2026-07-07)
|
|
2
16
|
|
|
3
17
|
- 新增 integration
|
package/lib/cloudrun/index.js
CHANGED
|
@@ -250,7 +250,7 @@ class CloudRunService {
|
|
|
250
250
|
*/
|
|
251
251
|
async deploy(params) {
|
|
252
252
|
var _a;
|
|
253
|
-
const { serverName, targetPath = process.cwd(), serverConfig, vpcInfo } = params;
|
|
253
|
+
const { serverName, targetPath = process.cwd(), serverConfig, vpcInfo, imageUrl } = params;
|
|
254
254
|
/**
|
|
255
255
|
* 参数校验和默认值设置
|
|
256
256
|
*/
|
|
@@ -260,30 +260,41 @@ class CloudRunService {
|
|
|
260
260
|
// 获取当前环境配置(包含EnvId)
|
|
261
261
|
const envConfig = this.environment.lazyEnvironmentConfig;
|
|
262
262
|
/**
|
|
263
|
-
*
|
|
263
|
+
* 根据部署类型构建 deployInfo
|
|
264
264
|
*/
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
265
|
+
let deployInfo;
|
|
266
|
+
if (imageUrl) {
|
|
267
|
+
// 镜像部署模式:直接使用镜像地址,无需上传代码包
|
|
268
|
+
deployInfo = {
|
|
269
|
+
DeployType: 'image',
|
|
270
|
+
ImageUrl: imageUrl
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
// 代码包部署模式:获取上传信息 → 打包 → 上传
|
|
275
|
+
const { UploadUrl: uploadUrl, UploadHeaders: uploadHeaders, PackageName: packageName, PackageVersion: packageVersion } = await this.tcbService.request('DescribeCloudBaseBuildService', {
|
|
276
|
+
EnvId: envConfig.EnvId,
|
|
277
|
+
ServiceName: serverName
|
|
278
|
+
});
|
|
279
|
+
deployInfo = {
|
|
280
|
+
DeployType: 'package',
|
|
281
|
+
PackageName: packageName,
|
|
282
|
+
PackageVersion: packageVersion
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* 上传部署包
|
|
286
|
+
*/
|
|
287
|
+
const zipFile = await codeToZip(targetPath, { installDependency: (serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.InstallDependency) !== undefined ? serverConfig.InstallDependency : true });
|
|
288
|
+
await (0, utils_1.upload)({
|
|
289
|
+
url: uploadUrl,
|
|
290
|
+
file: zipFile,
|
|
291
|
+
headers: (uploadHeaders || []).reduce((map, item) => {
|
|
292
|
+
map[item.Key] = item.Value;
|
|
293
|
+
return map;
|
|
294
|
+
}, {}) || {},
|
|
295
|
+
method: 'PUT'
|
|
296
|
+
});
|
|
297
|
+
}
|
|
287
298
|
/**
|
|
288
299
|
* 执行部署
|
|
289
300
|
*/
|
|
@@ -308,18 +319,18 @@ class CloudRunService {
|
|
|
308
319
|
else {
|
|
309
320
|
// 创建
|
|
310
321
|
/**
|
|
311
|
-
*
|
|
322
|
+
* 判断是容器还是函数型(镜像部署固定为 container)
|
|
312
323
|
*/
|
|
313
|
-
let type = 'function';
|
|
314
|
-
if (serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.Dockerfile) {
|
|
324
|
+
let type = imageUrl ? 'container' : 'function';
|
|
325
|
+
if (!imageUrl && (serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.Dockerfile)) {
|
|
315
326
|
type = 'container';
|
|
316
327
|
}
|
|
317
|
-
else {
|
|
328
|
+
else if (!imageUrl) {
|
|
318
329
|
if (await (0, fs_extra_1.pathExists)(path_1.default.join(targetPath, 'Dockerfile'))) {
|
|
319
330
|
type = 'container';
|
|
320
331
|
}
|
|
321
332
|
}
|
|
322
|
-
if (type === 'function') {
|
|
333
|
+
if (type === 'function' && !imageUrl) {
|
|
323
334
|
deployInfo.BuildPacks = {
|
|
324
335
|
LanguageVersion: '20.18',
|
|
325
336
|
RepoLanguage: 'Node.js'
|
package/lib/function/index.js
CHANGED
|
@@ -233,8 +233,8 @@ function configToParams(options) {
|
|
|
233
233
|
params.Code.ImageConfig = buildImageConfig(imageConfig);
|
|
234
234
|
}
|
|
235
235
|
// 第三阶段:统一应用默认值
|
|
236
|
-
const runtime = params.Runtime || '
|
|
237
|
-
return Object.assign({ Handler: func.handler || 'index.main',
|
|
236
|
+
const runtime = params.Runtime || 'Nodejs20.19';
|
|
237
|
+
return Object.assign({ Handler: func.handler || 'index.main', Runtime: 'Nodejs20.19', MemorySize: 256, InstallDependency: isNodeFunction(runtime) ? 'TRUE' : 'FALSE' }, params);
|
|
238
238
|
}
|
|
239
239
|
class FunctionService {
|
|
240
240
|
constructor(environment) {
|
package/package.json
CHANGED
|
@@ -128,6 +128,8 @@ export declare class CloudRunService {
|
|
|
128
128
|
deployInfo: {
|
|
129
129
|
ReleaseType: ReleaseTypeEnum;
|
|
130
130
|
};
|
|
131
|
+
/** 镜像地址,传入时走镜像部署模式,无需上传代码包 */
|
|
132
|
+
imageUrl?: string;
|
|
131
133
|
vpcInfo?: ICreateVpcInfo;
|
|
132
134
|
serverConfig?: Partial<Pick<ICloudrunServerBaseConfig, 'OpenAccessTypes' | 'Cpu' | 'Mem' | 'MinNum' | 'MaxNum' | 'PolicyDetails' | 'CustomLogs' | 'EnvParams' | 'Port' | 'Dockerfile' | 'BuildDir' | 'InternalAccess' | 'InternalDomain' | 'EntryPoint' | 'Cmd' | 'InstallDependency' | 'OperationMode' | 'SessionAffinity' | 'LogType' | 'LogSetId' | 'LogTopicId' | 'LogParseType' | 'Tag' | 'TimerScale' | 'VpcConf' | 'VolumesConf' | 'PublicNetConf'>>;
|
|
133
135
|
}): Promise<IResponseInfo>;
|