Create and Deploy Data Process
See Introduction and Setup first if you haven't gone through the steps above.
Also refer to LOC Feature Overview to learn more about LOC features, especially the hierarchy of projects, scenarios, data processes and logic.
In this article we'll see how to create and deploy a data process (as well as the project, scenario and associated logic) using LOC CLI.
Some actions require logged in since they would read or operate remote assets:
- Build logic
- Edit data process (to link deployed logic)
- Deploy project
See CLI Command Reference to knnow more about CLI commands.
Workspace Structure Overview
From CLI v0.8.0
, the new CLI workspace would look like this:
/[local workspace]
/.loc
/projects
projects.yaml <-- metadata of all projects, scenarios and data processes
logic-manifest.yaml <-- metadata of logic
/generic-logic-source <-- directory of generic logic source code
logic-1.js
logic-2.js
logic-3.ts
logic-4.ts
...
/aggregator-logic-source <-- directory of aggregator logic source code
aggregator-1.js
aggregator-2.ts
...
.locignore <-- files to be ignored during deploy
loc <-- CLI binary
package.json <-- local NPM package information
Unlike in v0.7.0
and previous versions, logic (source logic files) are now created and stored separately - and to be linked into data processes afterwards - while data processes are stored as metadata under projects and scenarios.
Deploy Logic
Create a Logic
Here we'll use the Quick Start tutorial as our example. First create the Payload JSON Parser
generic logic (CLI will prompt you for various fields and options):
> ./loc logic create
✔ Logic Name · payload-json-parser