Development Guide
Guidelines for extending the shared library, adding jobs, and contributing.
Local Setup
For contributors extending the project, cloning the repository is convenient; for operators, use the distributed bundle without cloning.
-
If developing locally, clone once and start master:
git clone https://gitlab.com/your-org/friendly-jenkins.git cd friendly-jenkins/jenkins-master docker compose up -d -
(Optional) Mount shared library for live edits:
# docker-compose.yml services: jenkins: volumes: - ../shared-library:/var/jenkins_home/qa-library:ro -
Enable hot reload in
casc.yaml:globalLibraries: libraries: - name: "qa-shared" retriever: legacySCM: scm: $class: "filesystem.FileSystemSCM" path: "/var/jenkins_home/qa-library" clearWorkspace: false
Adding a Pipeline Step
-
Place Groovy steps in
shared-library/vars/. -
Document parameters and return values in Javadoc comments.
-
Example skeleton:
/** * Validate environment configuration * @param envName Name of the environment * @return Map with validation results */ def call(String envName) { ansiColor('xterm') { stage('Validate Environment') { // implementation } } } -
Register a new job via Job DSL in the seed script and run seed to provision it.
Testing Changes
-
Compose up the master and run jobs against sample templates.
-
For library-only changes, mount the library locally and rerun the job.
-
Optional: add Spock specs under
test/if you maintain a Groovy test harness.