Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Latest commit

 

History

History
71 lines (49 loc) · 2.28 KB

routeDefaultJenkinsFile.md

File metadata and controls

71 lines (49 loc) · 2.28 KB

routeDefaultJenkinsFile

This is the main step that should be used inside Jenkinsfile that are stored in the project.

This step checks the properties of the current run and decides if the current run is simple pipeline run or a multibranch pipeline run.

When a project has no specialities, e.g. is running with

  • Apache Maven 3
  • JDK 8

this would be the content of the Jenkinsfile stored at project root:

@Library('pipeline-library') pipelineLibrary
@Library('pv-pipeline-library') pvPipelineLibrary

routeDefaultJenkinsFile()

With that construct

  • develop and master pipeline jobs will build with deploying the artifacts to nexus (buildDefault), and
  • feature/* multibranch pipeline jobs will build without deploying the artifacts to nexus (buildFeature)

Table of contents

Process

routeDefaultJenkinsFile

The routeDefaultJenkinsFile step checks if environment variables exists that identify a multi branch pipeline build.

Normal pipeline build

When a normal pipeline build is detected the step routes the execution to buildDefault step.

Multi branch pipeline build

When a multi branch pipeline build is detected the step routes the execution to the buildFeature step.

The step will then adjust the configuration for a feature branch build, e.g.

  • no deploy to nexus
  • automatically merge with master before build (only when running in trusted mode)

Finally the buildFeature calls also the buildDefault step with the adjusted configuration.

Configuration options

The configuration of this step is build out of the config options from the used steps.

The step itself has no specific configuration option. It just passes the config map to all config aware steps.

See

💡 Documentation about configuration