@mikarinneoracle/oci-cdk-code-only-preview 0.0.10 → 0.0.12

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 CHANGED
@@ -135,6 +135,8 @@ These settings are optional: `OCI_CODE_ONLY_SOURCE_DIR` (defaults to the current
135
135
 
136
136
  Each deploy re-builds `<function-name>.zip` in the project root and uploads that file. The ZIP has the required `function/` directory at its root, includes source files, and excludes `node_modules`, `.git`, `.tools`, `.terraform`, and `cdktf.out`. A successful code-only destroy removes this ZIP after Terraform has destroyed the Function App and infrastructure. The current preview path is function-only: it does not create an API Gateway because the CLI-managed function OCID is not in Terraform state.
137
137
 
138
+ After a successful code-only deploy, OCDK writes the log IDs for `npx ocdk tail:execution-log` automatically.
139
+
138
140
  Use the same flag or environment variable for deletion. OCDK deletes the CLI-managed function first, then lets Terraform destroy the Function App and its infrastructure:
139
141
 
140
142
  ```bash
@@ -144,9 +146,9 @@ npx ocdk destroy --code-only --auto-approve
144
146
  Run from your project root (where your `func.yaml` / function code and `node_modules/@mikarinneoracle/oci-cdk-code-only-preview` live):
145
147
 
146
148
  ```bash
147
- npx ocdk deploy
149
+ npx ocdk deploy --auto-approve --code-only
148
150
  npx ocdk tail:execution-log
149
- npx ocdk destroy
151
+ npx ocdk destroy --auto-approve --code-only
150
152
  ```
151
153
 
152
154
  - **`npx ocdk deploy`** – Deploy the stack. Options (e.g. `--auto-approve`) are passed through.
package/bin/ocdk.js CHANGED
@@ -180,7 +180,17 @@ if (command === 'deploy' && codeOnlyEnabled) {
180
180
  shell: false,
181
181
  env: { ...env, OCI_FUNCTION_APP_ID: functionAppId },
182
182
  });
183
- process.exit(result.status ?? 1);
183
+ if (result.status !== 0) process.exit(result.status ?? 1);
184
+ const logConfig = spawnSync('node', [path.join(root, 'bin', 'write-log-config.js')], {
185
+ stdio: 'inherit',
186
+ cwd: projectDir,
187
+ shell: false,
188
+ env,
189
+ });
190
+ if (logConfig.status !== 0) {
191
+ console.warn('Code-only function deployed, but log-tail configuration could not be written. Run: npx ocdk write-log-config');
192
+ }
193
+ process.exit(0);
184
194
  }
185
195
 
186
196
  // Destroy the CLI-managed archive function before Terraform destroys its
@@ -10,7 +10,7 @@ const fs = require('fs');
10
10
  const packageRoot = path.join(__dirname, '..');
11
11
  const projectRoot = process.cwd();
12
12
  const stackName = process.env.OCI_STACK_NAME || 'oci-stack';
13
- const stackDir = path.join(projectRoot, 'node_modules', '@mikarinneoracle', 'oci-cdk', 'cdktf.out', 'stacks', stackName);
13
+ const stackDir = path.join(packageRoot, 'cdktf.out', 'stacks', stackName);
14
14
 
15
15
  if (!fs.existsSync(stackDir)) {
16
16
  console.error('Stack directory not found:', stackDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikarinneoracle/oci-cdk-code-only-preview",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "OCI CDK stack for OCI Functions, API Gateway, and related infrastructure",
5
5
  "main": "lib/index.js",
6
6
  "bin": {