Skip to main content

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.

Example Flow for a S2I Pipeline.

How a pipeline uses S2I Builds

S2I Build.

S2I Introduction Video

Introduction Video S2I

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

NameDescriptionDefaultType
------------
argsstring
containerfile-pathAlternate path to the Containerfile, if either Dockerfile or Containerfile in the conect directory.string
dependenciesThe dependencies that this job depends on.[]array
export-enabledShould the source code in the working dir be exported as artifacts?falsestring
export-source-pathExport source path inside the container, if export-enabled is true./opt/app-root/srcstring
imageBase container image from the Red Hat image catalog to use as S2I builder image.string
namecontainerstring
needsThe jobs that this job depends on.[]array
pathPath to the directory containing Container sources / context..string
rulesThe 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
scannersScanners to use. none, vuln, license, secret, misconfig["vuln","secret","license","misconfig"]array
scanning-allow-failureShould the pipeline fail if scanning the built container image fails?falseboolean
scanning-enabledShould the built container image be scanned?trueboolean
scanning-severityWhat level of severity should cause scanning of the built container to fail?CRITICALstring
scanning-timeoutHow long should the scanning process be allowed to run before timing out? Use format e.g. 5m0sstring
stageThe pipeline stage that the jobs belongs to.buildstring
tagsThe runners that this job depends on.[]array
typenodejsstring
versionInternal version of the nested component to use.mainstring