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.
Parameter | Value | Description |
---|---|---|
PARAM_URL | Repository URL to clone from. | |
PARAM_REVISION | Revision to checkout. (branch, tag, sha, ref, etc...). | |
PARAM_SKIP | true | false | Skipping of initial cleanup of workspace folder. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
PRE_RELEASE_UNIQUENESS | true | false | Adds a timestamp to pre-release versions to ensure that every commit gets built without manually changing the version. |
ENFORCE_UNIQUENESS | true | false | Defines where uniqueness needs to be enforced by adding the current pipeline id to the version number. |
UNIQUE_SEMVER_CHECK | true | false | Will check if the current version has already been published or not to prevent previous versions to be overwritten unintentionally. |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
HELM_REPO_URL | URL of the configured helm repository. (value from secret 'k5-helm-repo-binding' and key 'url') | |
HELM_REPO_USERNAME | Username for accessing the helm repository. (value from secret 'k5-helm-repo-binding' and key 'username') | |
HELM_REPO_PASSWORD | Password for accessing the helm repository. (value from secret 'k5-helm-repo-binding' and key 'password') |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | Node.js configuration to optimize script execution for production environments. For Java based stacks the value is 'production', for Node based stacks keep the value empty. | |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
MVN_SETTINGS | Customized maven settings. Only for Java based stacks. (value from secret 'k5-build-settings' and key 'mvnSettings') | |
NPM_SETTINGS | Customized npm settings. Only for Node based stacks. (value from secret 'k5-build-settings' and key 'npmSettings') |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | Node.js configuration to optimize script execution for production environments. For Java based stacks the value is 'production', for Node based stacks keep the value empty. | |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
MVN_SETTINGS | Customized maven settings. Only for Java based stacks. (value from secret 'k5-build-settings' and key 'mvnSettings') | |
NPM_SETTINGS | Customized npm settings. Only for Node based stacks. (value from secret 'k5-build-settings' and key 'npmSettings') |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | Node.js configuration to optimize script execution for production environments. For Java based stacks the value is 'production', for Node based stacks keep the value empty. | |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
UNIT_TEST_FEATURE | Flag, if unit test feature was activated. | |
MVN_SETTINGS | Customized maven settings. Only for Java based stacks. (value from secret 'k5-build-settings' and key 'mvnSettings') | |
NPM_SETTINGS | Customized npm settings. Only for Node based stacks. (value from secret 'k5-build-settings' and key 'npmSettings') |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
SERVICE_PROJECT_IMAGE_REGISTRY | Registry, to push the created solution project image to. (value from secret 'k5-image-registry-binding' and key 'url') | |
DOCKER_AUTH_CONFIG | Container registry authentication data. (JSON data structure) | |
ADO_UBI_JDK_IMAGE_11 | Base container image for Java 11 solution projects. Only for Java based stacks. | |
ADO_UBI_JDK_IMAGE_17 | Base container image for Java 17 solution projects. Only for Java based stacks. | |
ADO_DOMAIN_SERVER_IMAGE_TARGET_NAME | Base image name for domain server. Only for Node based stacks. | |
ADO_DOMAIN_SERVER_IMAGE | Base image for domain server. Only for Node based stacks. | |
ADO_UBI_NODE_IMAGE | Base container image for node solution projects. Only for Node based stacks. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
SOLUTION_ACRONYM | Acronym of the service project. | |
PUBLISH | true | false | Flag to enable the push to the configured helm repository. |
SERVICE_PROJECT_IMAGE_REGISTRY | Registry, to push the created solution project image to. (value from secret 'k5-image-registry-binding' and key 'url') | |
HELM_REPO_URL | URL of the configured helm repository. (value from secret 'k5-helm-repo-binding' and key 'url') | |
HELM_REPO_USERNAME | Username for accessing the helm repository. (value from secret 'k5-helm-repo-binding' and key 'username') | |
HELM_REPO_PASSWORD | Password for accessing the helm repository. (value from secret 'k5-helm-repo-binding' and key 'password') | |
HELM_REPO_UPLOAD_URL | URL of the configured helm upload repository. (value from secret 'k5-helm-repo-binding' and key 'uploadUrl') | |
HELM_REPO_REQUEST_TYPE | Request type to upload the helm chart. (value from secret 'k5-helm-repo-binding' and key 'uploadRequestType') | |
HELM_REPO_UPLOAD_FILE_PATTERN | File pattern for the helm chart upload. (value from secret 'k5-helm-repo-binding' and key 'uploadFilePattern') | |
ADO_DS_IMAGE_BASETAG | Domain server base image tag. Only for Node based stacks. |
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.
Parameter | Value | Description |
---|---|---|
NODE_ENV | production | Node.js configuration to optimize script execution for production environments. |
STACK | TYPESCRIPT | JAVASCRIPT | NESTJS | JAVA | Name of the used 'stack'. |
K5_PROJECT | k5 project namespace to install the solution into. | |
PIPELINE_RUN | ID of the current pipeline run. | |
COMPONENT_IMAGE_REGISTRY | Registry, which contains the built solution project image. | |
REMOTE_LOGIN_FLAG | true | Internal solution deployment flag. (always 'true') |
DEPLOYMENT_CONFIG | Internal solution deployment configuration. | |
OC_LOGIN_URL | OpenShift login url. |