Type object
File match zinoma.yml
Schema URL https://catalog.lintel.tools/schemas/schemastore/inoma/latest.json
Source https://github.com/fbecart/zinoma/releases/latest/download/zinoma-schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Schema of the build flow configuration file zinoma.yml.

In order to use Žinoma with your project, you need to create a file named zinoma.yml. We recommend putting this file in the root directory of your project.

This struct describes the schema expected for this file. It assumes prior knowledge of the Yaml format.

Example

zinoma.yml:


test: input: - download_dependencies.output - paths: [package.json, src, test] build: npm test

lint: input: - download_dependencies.output - paths: [package.json, src, test] build: npm run lint

check: dependencies: [test, lint]

start: input: - download_dependencies.output - paths: [package.json, src] service: exec npm run start

build: dependencies: [check] input: - paths: - Dockerfile - package.json - package-lock.json - src output: - paths: [lambda.zip] build: | docker build -t build-my-project:latest . docker create -ti --name build-my-project build-my-project:latest bash docker cp build-my-project:/var/task/lambda.zip ./ docker rm -f build-my-project ```

In this example:

- `zinoma check` will ensure the code complies to the test suites and the coding standards. - `zinoma start --watch` will run the application and restart it whenever the sources are updated. - `zinoma --clean build` will generate a clean artifact, ready to be deployed.

A fully functional and more advanced example project is available in [fbecart/zinoma-node-example](https://github.com/fbecart/zinoma-node-example).

Properties

imports Record<string, string>

Import definitions from other Žinoma projects.

imports should be an object, the keys being the project names and the values their respective paths.

Before importing a project, you should make sure this project has its name defined. You should use the same name as key in the imports object.

Once a project is imported, targets from that project can be referenced by specifying their fully qualified name: imported_project_name::target_name.

Example

packages/api/zinoma.yml:


targets: test: build: cargo test ```

`packages/webapp/zinoma.yml`:

```yaml name: webapp

targets: test: build: cargo test ```

`./zinoma.yml`:

```yaml imports: api: packages/api webapp: packages/webapp

targets: test_all: dependencies: [api::test, webapp::test] ```

In this example, the target `test_all` depend from targets defined in different projects.
Default:
{}
name string | null

Name of the project.

A project name must be a string. It should start with an alphanumeric character or _ and contain only alphanumeric characters, -, or _.

Project names should be unique. Two projects cannot have the same name.

Example

yaml name: my_project

Default: null
targets Record<string, object | object | object>

Targets (aka tasks) of this project.

Targets represent commands and scripts to execute in your build flow.

Targets run in parallel by default. To force targets to run sequentially, you can define dependencies on other targets.

Each target must have a unique name inside the project. The target name must be a string. It should start with an alphanumeric character or _ and contain only alphanumeric characters, -, or _.

Example

yaml targets: speak_cow: build: echo 'Moo' speak_dog: build: echo 'Woof!'

In this example:

  • zinoma speak_cow will print Moo - zinoma speak_dog will print Woof! - zinoma speak_cow speak_dog will print both Moo and Woof! (not necessarily in this order)
Default:
{}

Definitions

Dependencies string[]

List of targets that must complete successfully before this target can be built.

It should be an array of strings.

If any of the dependencies fails to complete, this target will not be executed.

Example

yaml targets: target1: dependencies: [] target2: dependencies: [target1] target3: dependencies: [target2]

In this example, target1 must complete successfully before target2 begins, while target3 waits for target2 to complete.

zinoma target2 will run sequentially target1 and target2.

zinoma target3 will run sequentially target1, target2 and target3.

InputResource string | object | object
InputResources InputResource[]

List of artifacts that this target depends on.

input should be an array of resources.

Specifying a target's input enables the incremental build for this target. This means that, at the time of executing the target, Žinoma will skip its build if its input resources (and output resources, if any) have not changed since its last successful completion.

Example

yaml targets: npm_install: input: - paths: [package.json, package-lock.json] build: npm install

In this example, running zinoma npm_install once will execute npm install. Subsequent runs of zinoma npm_install will return immediately — until the content of package.json or package-lock.json is modified.

OutputResource object | object
OutputResources OutputResource[]

List of artifacts produced by this target.

It should be an array of resources.

The incremental build takes in account the target output. Just like with input, if any of the target output resources were altered since its previous successful execution, the target state will be invalidated and its build will be run again.

Example

yaml targets: npm_install: input: - paths: [package.json, package-lock.json] output: - paths: [node_modules] build: npm install

In this example, running zinoma npm_install will return immediately in case package.json, package-lock.json and node_modules were not modified since the last completion of the target.

Running zinoma --clean npm_install will start by deleting node_modules, then will run npm install.

Target object | object | object

A target is a command or a set of commands to run as part of your build flow.

Targets run in parallel by default. To force targets to run sequentially, you can define dependencies on other targets.