Description of Pipeline Steps
There are two pipeline configurations available for Java and Node based (Javascript & TypeScript) service projects by default.
For Generic Service Projects some steps are not applicable and therefore skipped.
Depending on your project stack (Java | Node), the available pipeline types are shown in the Solution Designer (CI/CD page). The pipeline type can be considered as pipeline template from which your service project pipeline will be created.
It is possible to add own pipeline templates to the available types, see Pipeline Customization.
A created pipeline always consists of multiple Pipeline Tasks. The following Tasks are part of the Default Pipeline, but can also be used in custom pipelines.
These tasks are able to validate, build, test and release its related stack service projects.
Task steps overview
- k5-git-clone
- k5-validate
- k5-generate-code-java / k5-generate-code-node
- k5-build-application-java / k5-build-application-node
- k5-build-publish-image-java / k5-build-publish-image-node
- k5-build-publish-chart-java / k5-build-publish-chart-node
- k5-deploy
Any failure in a step, will be shown in the pipeline run's logs and will cause the pipeline to fail.
Some of the Tasks can handle both Stacks (Java / Node). Some of the Tasks are Stack specific.
Task: k5-git-clone
Typically, the first step of every pipeline is the git clone. The k5-git-clone
task only consists of the git-clone
step
that will clone the git project into the /workspace/source
folder. The cloned git project can be used in the following Pipeline Tasks.
Task: k5-validate
The k5-validate
task is responsible for validate the cloned git project in the following steps:
Step: prepare-validate-design-model
Validates the design model (Yaml structure, API model, domain model and project manifest).
The validation result is shown in the logs of the pipeline run.
This step only runs for Domain Service Projects, for Generic Service Projects it will be skipped.
Step: prepare-denormalize-domain-model
This step takes a normalized design model of a project and converts it to its denormalized model form.
The denormalized model is needed for the "generate" and "build" steps.
Will only run for Domain Service Projects, for Generic Service Projects it will be skipped.
Step: handle-version
This step validates service project's version and applies the pipeline's version related configuration pipeline configurations such as adding a timestamp or performing SemVer uniqueness check.
This version will be used as the release version of your service project and also will be part of your released service project's Helm chart name.
If service project version fails the SemVer uniqueness check, it will be shown in the logs of the pipeline run and the pipeline run will fail.
Task: k5-generate-code-java / k5-generate-code-node
The k5-generate-code-java
respectively k5-generate-code-node
task is responsible for code generation and consists of the following steps:
Step: build-baw-toolkit
The step takes one or more Swagger files and transforms them into IBM Business Automation Workflow importable toolkits.
The toolkits are downloadable in the Details view of a project in the Solution Envoy.
Will only run for Domain Service Projects, for Generic Service Projects it will be skipped.
Step: generate-code
This step takes the domain model of the project and generates/includes all code necessary to produce a working service project action executable.
The resulting artifact will be a Node.js / Spring Boot application that runs inside k5-project deployment.
Will only run for Domain Service Projects, for Generic Service Projects it will be skipped.
Task: k5-build-application-java / k5-build-application-node
The k5-build-application-java
respectively k5-build-application-node
task is responsible for building the application
and consists of the following steps:
Step: build-code
This step builds the service project's implementation code.
It will run npm compile
for Node.js based stacks or maven build
for Java stacks. If any errors occur, they will be
shown in the logs of the pipeline run and the pipeline run will fail.
Step: unit-test
This step runs the unit tests for your service project. If any test failure occurs, it will be shown in the logs of the pipeline run and the pipeline run will fail.
This step will be skipped if the pipeline configurations "unit test" flag is set to false.
For projects based on a Node.js stack:
- The command
npm run test:unit
will be executed. - More info on unit tests here Unit testing for TypeScript / JavaScript projects
For projects based on a Java stack:
- The command
maven test
will be executed.
Task: k5-build-publish-image-java / k5-build-publish-image-node
The k5-build-publish-image-java
respectively k5-build-publish-image-node
task is responsible for building and pushing
the container image of the service project and consists of the following step:
Step: build-publish-image
Creates the container image containing the service project's built code and all its related artifacts such as IBM BAW toolkit(s) and generated Open API 3.0 / Swagger 2.0 api specifications.
The container image is published to the Container Registry configured with the pipeline.
Task: k5-build-publish-chart-java / k5-build-publish-chart-node
The k5-build-publish-chart-java
respectively k5-build-publish-chart-node
task is responsible for building and pushing
the helm chart of the service project and consists of the following step:
Step: pack-helm-chart
Creates the Helm chart needed for deploying the service project.
The Helm chart is published to the Helm registry (component repository) configured with the pipeline, if it is a Release pipeline. Otherwise the Helm chart is only used locally.
Task: k5-deploy
The k5-deploy
task is only available in a Deploy pipeline and responsible for deploying the service project into the configured
deployment target (k5-project) and consists of the following step:
Step: deploy-solution
It deploys the service project's Helm chart into the chosen deployment target (k5-project) associated with the pipeline run. In case of a Release pipeline, this step is skipped.