Skip to content

Commit 4ca1c1b

Browse files
authored
Merge pull request #156 from devsapp/feat/micro-sandbox-runtime
feat: add micro-sandbox runtime support
2 parents c56b0ed + d147219 commit 4ca1c1b

8 files changed

Lines changed: 22 additions & 14 deletions

File tree

__tests__/ut/resources/fc/impl/utils_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ describe('utils', () => {
3030
expect(result).toBe(true);
3131
});
3232

33+
it('should return true for micro-sandbox runtime', () => {
34+
const result = isCustomContainerRuntime('micro-sandbox');
35+
expect(result).toBe(true);
36+
});
37+
3338
it('should return false for non custom-container runtime', () => {
3439
const result = isCustomContainerRuntime('nodejs18');
3540
expect(result).toBe(false);

package-lock.json

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"@alicloud/devs20230714": "^2.5.0",
2626
"@alicloud/fc2": "^2.6.6",
27-
"@alicloud/fc20230330": "4.7.4",
27+
"@alicloud/fc20230330": "4.7.5",
2828
"@alicloud/pop-core": "^1.8.0",
2929
"@serverless-cd/srm-aliyun-oss": "^0.0.1-beta.8",
3030
"@serverless-cd/srm-aliyun-pop-core": "^0.0.8-beta.1",

publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Type: Component
33
Name: fc3
44
Provider:
55
- 阿里云
6-
Version: 0.1.21
6+
Version: 0.1.22
77
Description: 阿里云函数计算全生命周期管理
88
HomePage: https://github.com/devsapp/fc3
99
Organization: 阿里云函数计算(FC)

src/interface/base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export enum Runtime {
4040
'custom.debian12' = 'custom.debian12',
4141
'custom' = 'custom',
4242
'custom-container' = 'custom-container',
43+
'micro-sandbox' = 'micro-sandbox',
4344
}
4445

4546
export const RuntimeList = Object.values(Runtime);

src/resources/fc/impl/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as path from 'path';
77
import { isDebugMode } from '@serverless-devs/utils';
88

99
export function isCustomContainerRuntime(runtime: string): boolean {
10-
return runtime === Runtime['custom-container'];
10+
return runtime === Runtime['custom-container'] || runtime === Runtime['micro-sandbox'];
1111
}
1212

1313
export function isCustomRuntime(runtime: string): boolean {

src/schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@
863863
"enum": [
864864
"custom",
865865
"custom-container",
866+
"micro-sandbox",
866867
"custom.debian10",
867868
"custom.debian11",
868869
"custom.debian12",
@@ -1428,7 +1429,7 @@
14281429
"properties": {
14291430
"runtime": {
14301431
"type": "string",
1431-
"const": "custom-container"
1432+
"enum": ["custom-container", "micro-sandbox"]
14321433
}
14331434
}
14341435
},

src/subCommands/local/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export default class ComponentLocal {
8383
await customLocalInvoker.invoke();
8484
break;
8585
}
86-
case 'custom-container': {
86+
case 'custom-container':
87+
case 'micro-sandbox': {
8788
const customContainerLocalInvoker = new CustomContainerLocalInvoke(inputs);
8889
await customContainerLocalInvoker.invoke();
8990
break;
@@ -156,7 +157,8 @@ export default class ComponentLocal {
156157
await customLocalStart.start();
157158
break;
158159
}
159-
case 'custom-container': {
160+
case 'custom-container':
161+
case 'micro-sandbox': {
160162
const customContainerLocalStart = new CustomContainerLocalStart(inputs);
161163
await customContainerLocalStart.start();
162164
break;

0 commit comments

Comments
 (0)