@mikarinneoracle/oci-cdk-code-only-preview 0.0.21 → 0.0.22
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/README.md +18 -0
- package/bin/deploy-code-only.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,24 @@ export OCI_FUNCTION_HANDLER='func.handler'
|
|
|
124
124
|
npx ocdk deploy --auto-approve --code-only
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
For a Node.js function, use the Node launch command as the handler (not `fdk.handle`):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
export OCI_CODE_ONLY_RUNTIME_NAME='node24.ol9'
|
|
131
|
+
export OCI_FUNCTION_HANDLER='node func.js'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The equivalent `func.yaml` configuration is supported too, so the handler environment variable is unnecessary when this file contains `entrypoint: node func.js`:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
schema_version: 20180708
|
|
138
|
+
name: my-node-function
|
|
139
|
+
runtime: node
|
|
140
|
+
entrypoint: node func.js
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Keep `@fnproject/fdk` in `package.json` dependencies. The function source file uses `fdk.handle(...)`; it is not the OCI handler value.
|
|
144
|
+
|
|
127
145
|
#### Find the available code-only runtimes
|
|
128
146
|
|
|
129
147
|
The exact `OCI_CODE_ONLY_RUNTIME_NAME` values are enabled per tenancy and region during this Limited Availability preview. Query the Preview CLI instead of copying a runtime name from another environment:
|
package/bin/deploy-code-only.js
CHANGED
|
@@ -54,7 +54,7 @@ function readFunctionMetadata() {
|
|
|
54
54
|
const yaml = fs.existsSync(funcYamlPath) ? fs.readFileSync(funcYamlPath, 'utf8') : '';
|
|
55
55
|
const functionName = (process.env.OCI_FUNCTION_NAME || yamlValue(yaml, 'name')).trim();
|
|
56
56
|
const appName = (process.env.OCI_FUNCTION_APP_NAME || functionName).trim();
|
|
57
|
-
const handler = (process.env.OCI_FUNCTION_HANDLER || yamlValue(yaml, 'cmd')).trim();
|
|
57
|
+
const handler = (process.env.OCI_FUNCTION_HANDLER || yamlValue(yaml, 'cmd') || yamlValue(yaml, 'entrypoint')).trim();
|
|
58
58
|
const runtimeName = (process.env.OCI_CODE_ONLY_RUNTIME_NAME || '').trim();
|
|
59
59
|
const memory = integerValue(process.env.OCI_FUNCTION_MEMORY_MB || yamlValue(yaml, 'memory'), 'OCI_FUNCTION_MEMORY_MB', 256);
|
|
60
60
|
const timeout = integerValue(process.env.OCI_FUNCTION_TIMEOUT_SECONDS || yamlValue(yaml, 'timeout'), 'OCI_FUNCTION_TIMEOUT_SECONDS', 30);
|