Understanding S2I pipelines
S2I is a process to build images from source code.
Example Overview of a S2I Pipeline
The pipeline will iterate through the stages in GitLab and stop execution on error.
.
How a pipeline uses S2I Builds
.
S2I Introduction Video
Usage
- Create a new project with a node source code in the root.
- Create GitLab pipeline file
.gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/s2i@stable
inputs:
name: myapplication
type: nodejs
image: registry.access.redhat.com/ubi10/nodejs-22:10.0-1761020302
path: .
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| args | string | ||
| containerfile-path | Alternate path to the Containerfile, if either Dockerfile or Containerfile in the conect directory. | string | |
| dependencies | The dependencies that this job depends on. | [] | array |
| export-enabled | Should the source code in the working dir be exported as artifacts? | false | string |
| export-source-path | Export source path inside the container, if export-enabled is true. | /opt/app-root/src | string |
| image | Base container image from the Red Hat image catalog to use as S2I builder image. | string | |
| name | container | string | |
| needs | The jobs that this job depends on. | [] | array |
| path | Path to the directory containing Container sources / context. | . | string |
| rules | The jobs that this job depends on. | [{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}] | array |
| scanners | Scanners to use. none, vuln, license, secret, misconfig | ["vuln","secret","license","misconfig"] | array |
| scanning-allow-failure | Should the pipeline fail if scanning the built container image fails? | false | boolean |
| scanning-enabled | Should the built container image be scanned? | true | boolean |
| scanning-severity | What level of severity should cause scanning of the built container to fail? | CRITICAL | string |
| scanning-timeout | How long should the scanning process be allowed to run before timing out? Use format e.g. 5m0s | string | |
| stage | The pipeline stage that the jobs belongs to. | build | string |
| tags | The runners that this job depends on. | [] | array |
| type | nodejs | string | |
| version | Internal version of the nested component to use. | main | string |
