4.0 KiB
4.0 KiB
Generated 2026-05-12 at base-sha 28f54cf7bef9. Type: top-level. 0 sources.
Entry Points
The vars/ directory contains every Groovy script that is callable from a consumer Jenkinsfile. Each file in vars/ becomes a global function in the Jenkins pipeline namespace.
TL;DR
eksCICDis the primary entry point used by all microservices.buildPipelineis a legacy wrapper kept for backward compatibility.gkeCICD,gcpMigration,cloudFunctionCICDare specialised for specific infra targets.createEKSconfigsandonlyPushtoJfrogare utility entry points, not full CI/CD flows.log,stageName,automationTestare helper utilities exposed as global functions.
Mental model
Any .groovy file placed in vars/ is automatically loaded by Jenkins as a global variable/function. Consumer Jenkinsfiles call these directly: eksCICD(repo), buildPipeline(repo), etc. There is no package declaration in vars/ files — they are scripts, not classes.
Structure / data flow
vars/
├─ eksCICD.groovy Primary entry — all active microservices
├─ buildPipeline.groovy Legacy alias → wraps eksCICD
├─ gkeCICD.groovy GKE-specific pipeline (minimal stub)
├─ gcpMigration.groovy AWS→GCP migration helper
├─ cloudFunctionCICD.groovy Cloud Functions CI/CD
├─ createEKSconfigs.groovy EKS kubeconfig bootstrapper
├─ onlyPushtoJfrog.groovy Pushes JAR to JFrog without full pipeline
├─ automationTest.groovy Automation test runner entry
├─ buildDockerGroovyGke.groovy Docker build for GKE target
├─ log.groovy Global log.info/log.error/log.warn helpers
└─ stageName.groovy Returns stage name string for display
Key code locations
| Symbol | File | What it does |
|---|---|---|
call |
vars/eksCICD.groovy:call |
Main CI/CD flow — auth guard, infra routing |
call |
vars/buildPipeline.groovy:18 |
Legacy entry — delegates to eksCICD internals |
call |
vars/gkeCICD.groovy:1 |
GKE variant (thin stub) |
call |
vars/cloudFunctionCICD.groovy:1 |
Cloud Functions deployment flow |
call |
vars/createEKSconfigs.groovy:1 |
EKS kubeconfig bootstrap utility |
call |
vars/log.groovy:1 |
Global logging helper (info/error/warn) |
Sharp edges
vars/scripts run in the Jenkins CPS interpreter. Any non-serializable Java object (iterators, closures with complex state) passed fromvars/to a@NonCPSmethod will throwNotSerializableExceptionat runtime.buildPipelineis legacy — do not add new consumers to it. All new services should useeksCICD.log.groovyshadows Jenkins' built-inechoin some contexts — if you see unexpected log formatting, check whetherlog.infoorechowas used.automationTest.groovyis independent — it does not go througheksCICD; automation test repos call it directly.scmis only available in consumer Jenkinsfiles: thescmvariable (branch, remote URL, credentials) is injected by the GitHub Branch Source plugin into consumer Jenkinsfiles only — not intovars/orsrc/of the shared library. Referencingscm.branchesin library code causesMissingPropertyExceptionat runtime. Useenv.BRANCH_NAME,env.GIT_URL, orenv.CHANGE_*instead.
See also: SCM variable scope
Related concepts
- Architecture — how eksCICD orchestrates the pipeline
- Build stages — what runs after the entry point selects infra
- Environment mapping — branch-to-env resolution
- SCM variable scope — why
scmis unavailable in library code
Notes
← Previous · Index · Next →