@mikarinneoracle/oci-cdk-code-only-preview 0.0.2 → 0.0.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/README.md +29 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,10 +86,17 @@ Only **`OCI_COMPARTMENT_ID`** (or `OCI_COMPARTMENT_OCID`) is required for deploy
|
|
|
86
86
|
|
|
87
87
|
### Using an OCI CLI preview installation
|
|
88
88
|
|
|
89
|
-
Choose a non-default CLI executable without changing your shell `PATH
|
|
89
|
+
Choose a non-default CLI executable without changing your shell `PATH`. `OCI_CLI_PATH` must be the absolute path to the preview binary, not merely the directory containing it:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
export OCI_CLI_PATH="
|
|
92
|
+
export OCI_CLI_PATH="/absolute/path/to/oci-preview-bin/oci"
|
|
93
|
+
"$OCI_CLI_PATH" --version
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For the repository-local preview installation used in this checkout:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
export OCI_CLI_PATH="/Users/MRINNE/projects/ocdk/.tools/oci-preview-bin/oci"
|
|
93
100
|
```
|
|
94
101
|
|
|
95
102
|
The repository-local preview installation is required only for preview-only features such as Code-only Functions. Regular deployments continue to use `oci` from `PATH` unless `OCI_CLI_PATH` is set.
|
|
@@ -101,15 +108,31 @@ Code-only deployment first uses Terraform to create or manage the Function Appli
|
|
|
101
108
|
Activate the path with either `-code-only`, `--code-only`, or `OCI_CODE_ONLY=1`. The compatibility environment key `code-only=1` is also recognized when a process launcher can set a hyphenated environment name.
|
|
102
109
|
|
|
103
110
|
```bash
|
|
104
|
-
|
|
111
|
+
# Required: OCI CLI preview binary
|
|
112
|
+
export OCI_CLI_PATH="/Users/MRINNE/projects/ocdk/.tools/oci-preview-bin/oci"
|
|
113
|
+
"$OCI_CLI_PATH" --version
|
|
114
|
+
|
|
115
|
+
# Required: OCI target
|
|
105
116
|
export OCI_COMPARTMENT_ID='ocid1.compartment.oc1...'
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
|
|
118
|
+
# Required: code-only runtime and handler
|
|
108
119
|
export OCI_CODE_ONLY_RUNTIME_NAME='python312.ol9'
|
|
109
120
|
export OCI_FUNCTION_HANDLER='func.handler'
|
|
110
|
-
|
|
121
|
+
|
|
122
|
+
# Required in func.yaml: name: my-function
|
|
123
|
+
# Terraform creates the Function App; OCI CLI preview uploads the ZIP function
|
|
124
|
+
npx ocdk deploy --auto-approve --code-only
|
|
111
125
|
```
|
|
112
126
|
|
|
127
|
+
By default, the function name and Function App name both come from `func.yaml`'s `name`. Set these only to override that default or to use a differently named existing Function App:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
export OCI_FUNCTION_NAME='my-function'
|
|
131
|
+
export OCI_FUNCTION_APP_NAME='my-existing-function-app'
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
These settings are optional: `OCI_CODE_ONLY_SOURCE_DIR` (defaults to the current directory), `OCI_FUNCTION_MEMORY_MB` (from `func.yaml`, otherwise `256`), and `OCI_FUNCTION_TIMEOUT_SECONDS` (from `func.yaml`, otherwise `30`). `OCI_TENANCY_ID`, `OCI_REGION`, and `OCI_NAMESPACE` are also optional when they can be resolved from the active OCI CLI profile.
|
|
135
|
+
|
|
113
136
|
The archive is built from `OCI_CODE_ONLY_SOURCE_DIR` (or the current directory). It includes source files and excludes `node_modules`, `.git`, `.tools`, `.terraform`, and `cdktf.out`. 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.
|
|
114
137
|
|
|
115
138
|
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:
|