jenkins.yaml Configuration Reference
The jenkins.yaml file in your project root defines how JSL orchestrates your build and deployment pipeline. This is the contract between your project configuration and JSL’s automation.
Core Configuration Keys
Build & Language
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
string |
✓ |
Docker image repository path (e.g., |
|
|
string |
|
Programming language: |
|
|
string |
|
Build orchestration: |
|
|
string |
|
Image building tool: |
|
|
string |
|
Project directory (use |
Artifact & Versioning
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
string |
Maven group ID (auto-detected from pom.xml if not set) |
||
|
string |
Maven artifact ID (auto-detected from pom.xml if not set) |
||
|
string |
Project version (auto-detected from pom.xml if not set) |
||
|
string |
Major version number (auto-detected from pom.xml if not set) |
||
|
string |
Override version for deployments (defaults to |
Deployment
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
string |
Target Kubernetes namespace for deployment |
||
|
boolean |
|
Skip build/test stages; deploy only |
|
|
boolean |
Auto-deploy to target environments (when enabled in JSL config) |
||
|
string |
Git branch regex to trigger image push (e.g., |
||
|
boolean |
Check if image already exists before rebuilding |
Scanning & Quality
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
string |
JIRA project key (required for OIS scan) |
||
|
boolean |
|
Enable OIS security scanning |
|
|
boolean |
Enable SonarQube scanning |
||
|
string |
SonarQube server URL for publishing results |
||
|
string |
Branch to report Sonar results to (defaults to current branch) |
||
|
boolean |
Run Sonar only on main branch |
||
|
boolean |
Enforce SonarQube quality gates (fail build if gates fail) |
Notifications
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
boolean |
Send Slack notifications on build events |
||
|
string |
Slack channel for success notifications (without |
||
|
string |
Slack channel for failure notifications (without |
Advanced / Release
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
boolean |
Tag repository on successful build (requires |
||
|
string |
Git repository URL for release tagging |
||
|
string |
Maven options for snapshot artifact deployment |
||
|
string |
Maven options for release artifact deployment |
||
|
boolean |
Skip the entire pipeline (useful for temporary disables) |
||
|
boolean |
Enable credential caching (optimization) |
Periodic & Special Builds
| Key | Type | Default | Required | Description |
|---|---|---|---|---|
|
object |
Configure cron-based periodic builds |
||
|
string |
Git branch to run periodic build on |
||
|
string |
Cron expression (e.g., |
||
|
boolean |
Enable API testing via Postman Newman |
Adding New Configuration Keys to JSL
When you need to add a new configuration option:
-
Add it to the JSL groovy file that handles that stage (e.g.,
buildServiceProject.groovy,sonarScan.groovy)-
Extract the value:
def myNewKey = config.myNewKey ?: defaultValue -
Use it in your logic
-
-
Document the key in this reference with type, default, required status, and description
-
Add an example in one of the example files (
jenkins-service-example.yaml,jenkins-web-example.yaml, etc.) if it’s commonly used -
Update the JSL CHANGELOG noting the new configuration option and when it was introduced
-
Test with a real project to ensure the key is read and used correctly
-
Consider backwards compatibility — if changing an existing key’s behavior, ensure old configurations still work or provide a clear migration path
Example jenkins.yaml Files
See the JSL repository examples/ directory for complete, commented examples:
-
jenkins-service-example.yaml— Java backend service -
jenkins-web-example.yaml— JavaScript frontend -
jenkins-library-example.yaml— Shared library projects -
jenkins-mock-example.yaml— Mock services
Overriding jenkins.yaml Values at Runtime
Some JSL functions support dynamic parameter overrides:
-
DEPLOY_NAMESPACE— override deployment namespace -
DEPLOY_VERSION— override version to deploy -
RUN_SONAR_ONLY— run only Sonar scanning stage
Check individual JSL function documentation for additional runtime parameters.