Pipeline syntax
Define Microtica pipelines declaratively in YAML. Set the runtime, group steps into stages, and control the compute type at the pipeline or step level.
Microtica has built-in support for defining and running pipelines. You write the pipeline declaratively in YAML, directly in the microtica.yaml file at the root of your source code.
Here is the skeleton of a Microtica pipeline:
runtime:
computeType: SMALL|MEDIUM|LARGE
stages:
- [stage-name]
- [another-stage-name]
steps:
step_name:
[step-body]
other_step_name:
[step-body]- runtime (optional) – the runtime configuration for the pipeline
- computeType – runtime environment compute type
- stages (optional) – a list of stage names. Each stage can be assigned to one or multiple steps
- steps – a dictionary of steps
Basic pipeline definition
Here is a simple pipeline definition:
steps:
Clone:
title: Clone my source code from Git
type: git-clone
BuildAndTest:
title: Build my microservice
image: node:12-alpine
commands:
- npm install
- npm run build
PushDockerImage:
type: docker-push
image_name: my_app_image
tag: {{version}}
registry: dockerhubThis pipeline has three steps:
- Clone – clones the source code from the Git repository
- BuildAndTest – installs node modules and compiles the Node.js source code
- PushDockerImage – builds and pushes a Docker image to the specified registry
Runtime environment
Each pipeline step runs in a separate runtime environment to keep step execution secure and isolated.
You can set the compute type of the runtime environment at the pipeline level and at the individual step level.
Compute type corresponds to the amount of CPU and memory to be allocated for the pipeline.
To configure the compute type at the pipeline level, see the example below:
runtime:
computeType: SMALLTo configure the compute type at the step level and override the pipeline configuration, see the example below:
runtime:
computeType: SMALL
steps:
Clone:
title: Clone my source code from Git
type: git-clone
Build:
image: node:12-alpine
runtime:
computeType: MEDIUM
commands:
- npm install
Test:
image: node:12-alpine
commands:
- npm test
With this configuration, the Test step uses the default compute environment of type SMALL, but the Build step uses the compute environment of type MEDIUM.
To optimize the price and the performance of your pipeline executions, use compute types appropriate for the operations you are performing in the steps.
Use SMALL for steps that don't require high performance, and use MEDIUM and LARGE for steps that need more compute and memory intensive operations.
Execution flow
Steps run in serial, in the order they are defined in the pipeline.
Here is an example of a pipeline with multiple steps:
steps:
Clone:
title: Clone my source code from Git
type: git-clone
BuildMyApp:
image: node:12-alpine
commands:
- npm install
- npm run build
TestMyApp:
image: node:12-alpine
commands:
- npm test
GenerateTestReports:
image: node:12-alpine
commands:
- npm run generate-reportsThe pipeline runs Clone first, then BuildMyApp. When that step finishes successfully, TestMyApp runs. Following the same logic, GenerateTestReports runs once TestMyApp completes successfully.
Next steps
Pipelines
Automate your software delivery in Microtica with pipelines that run each step in its own Docker container, so you can mix frameworks and tools in one flow.
Steps
Build Microtica pipelines from steps. Use generic steps to run your own commands in any Docker image, or built-in steps for common CI/CD actions.