F Oracle JET CLI API for CI/CD
Oracle JET provides a public, programmatic API for the Oracle JET CLI.
This API enables execution of the following tasks in CI/CD pipelines, such as the pipelines provided by Oracle Visual Builder Studio.
In most circumstances calling the Oracle JET CLI as a shell task in the pipeline should provide sufficient functionality, but this API is available for advanced use cases.
ojet buildojet restoreojet stripojet packageojet publish
You create a new instance of the API as follows:
const Ojet = require("@oracle/ojet-cli");
const ojet = new Ojet({ cwd: "path/to/invoke/ojet/from" });
Use npm link @oracle/ojet-cli from your project if you are using a globally-installed Oracle JET CLI (npm install -g @oracle/ojet-cli).
The following options are supported when you create a new instance of the API.
| Option | Type | Description |
|---|---|---|
cwd
|
string | Path from where you invoke the Oracle JET CLI. |
logs
|
boolean | Controls ojet logging. |
Properties
| Name | Type | Description |
|---|---|---|
| version | string |
Version of @oracle/ojet-cli |
Method
The Oracle JET CLI API for CI/CD pipelines exposes one method, execute, that executes a CLI task and returns a promise which resolves to undefined on success and failure. The execute method supports the following options.
| Option | Type | Description |
|---|---|---|
task
|
"build" | "restore" | "strip" |
"package" | "publish"
|
Name of the task to execute. |
scope
|
"app" | "component" |
"pack"
|
Scope of the task to execute. |
parameters
|
string[]
|
Parameters of the task to execute. |
options
|
object
|
Options to execute the task with. |
Examples
| Example | Code |
|---|---|
ojet build
|
|
ojet build
--release
|
|
ojet restore
|
|
ojet strip
|
|
ojet package component
<component>
|
|
ojet package pack
<pack>
|
|
ojet publish component
<component> --username=<username> --password=<password>
--secure=<true|false> --path=<path>
|
|
ojet publish pack <pack>
--username=<username> --password=<password>
--secure=<true|false>
|
|