Core Concepts
Pipelines
Pipeline Syntax
7min
microtica provides a built in support for defining and executing pipelines the pipeline is defined using yaml syntax which allows creating pipelines in a declarative way the pipeline can be defined directly in the microtica yaml definition file placed in your source code root dir the following is a skeleton of microtica pipeline syntax microtica yaml 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 the following is a very simple pipeline definition microtica yaml 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 dockerhub this pipeline consists of two steps clone – clones the source code from the git repository buildandtest – install node modules and compile the nodejs source code pushdockerimage – build and push docker image to a specified registry runtime environment each pipeline step runs in a separate runtime environment to ensure security and isolation of the step execution microtica allows you to set the compute type of the runtime environment on pipeline and individual step level compute type corresponds to the amount of cpu and memory to be allocated for the pipeline to configure the compute type on pipeline level see the example below microtica yaml runtime computetype small if you want to configure the compute type on a step level and override the pipeline configuration then see the example below microtica yaml 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 test step will use the default compute environment of type small but the build step will use 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 type for steps that don’t require high performance and use medium and large types for steps that require more compute and memory intensive operations execution flow steps are executed in serial in the order they are defined in the pipeline definition here is an example of pipeline with multiple steps microtica yaml 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 reports pipeline starts by executing clone step then buildmyapp step, when this step finishes successfully with its execution, testmyapp step is triggered for execution following the same logic, generatetestreports will execute when testmyapp step completes successfully