5.0 KiB
Generated 2026-05-12 at base-sha 28f54cf7bef9. Type: top-level. 0 sources.
Language Builds
Each language builder in src/com/meesho/stages/ implements a run(Map config) method. They share a common structure: read config → config-only check → compile/test → Sonar → Docker build → push → deploy.
TL;DR
- Maven (
buildMaven): Java services using pom.xml. Handles multi-module layouts. Skips tests/sonar on hotfix. Pushes JAR to JFrog optionally. - Go (
buildGo): Uses Athens proxy (env.goProxyUrl) for module caching. Sonar skipped if whitelisted or toolchain env. - Node (
buildNode): Multiple variants (node-18,node-20, etc.). Toolchain-aware image path includesTOOLCHAIN_ENVsegment. - Python (
buildPython):python-3.10,python-3.12, etc. — version indockerBuildVersion, not separate files. - Gradle (
buildGradle): Android/Kotlin server builds. - PHP (
buildPhp): PHP services, usesphp-values.yamlHelm template. - Rust (
buildRust): Rust services. - Docker (
buildDocker): Docker-only builds — no compiler, just image assembly.
Mental model
Every builder reads config.build_tool (via buildObjHelper dispatch) and config.dockerBuildVersion. The dockerBuildVersion controls which Dockerfile template is selected from resources/com/meesho/ — the template name roughly mirrors the version string (e.g., maven-21, go-1.22, node-20).
Config-only change detection is embedded in each builder. If git diff HEAD~1 -- configs/ shows only YAML changes, the builder skips compilation and fetches the last image tag from GAR instead.
Structure / data flow
buildMaven.run(config):
env.TAG = "v${pom-version}" or hotfix → "v${version}-HOT"
├─ [config-only] check s3/GAR for existing artifact
├─ stage: Test → mvn test -P${java_version}
├─ stage: Sonar → mvn sonar:sonar (skip if skipSonarCheckForbidden)
├─ stage: Docker Build → constructTemplate.renderTemplate(binding, 'maven-Dockerfile')
├─ stage: Docker Push → dockerUtilities.buildAndPush(...)
└─ deployArgoCD.run(...) or deployJar.run(...)
buildGo.buildDckr(config):
env.TAG = getDockerParams.getTag(repo_name)
├─ [config-only] skip build if only configs/ changed
├─ stage: Build/Test → go build, go test (with Athens proxy)
├─ stage: Sonar → sonar-scanner (skip if skipSonarCheckForGo)
├─ stage: Docker Build → constructTemplate.renderTemplate(binding, 'go-Dockerfile')
└─ deployArgoCD.run(...)
buildNode.buildDckr(config):
env.TAG = getDockerParams.getTag(repo_name)
├─ npm install + npm run build
├─ stage: Sonar → sonar-scanner (node sonar/sonar-scanner.ts)
├─ stage: Docker Build → constructTemplate.renderTemplate(binding, 'node-Dockerfile')
└─ deployArgoCD.run(...)
Key code locations
| Symbol | File | What it does |
|---|---|---|
run |
src/com/meesho/stages/buildMaven.groovy:run |
Maven build lifecycle |
buildDckr |
src/com/meesho/stages/buildGo.groovy:buildDckr |
Go build lifecycle |
buildDckr |
src/com/meesho/stages/buildNode.groovy:buildDckr |
Node build lifecycle |
buildDckr |
src/com/meesho/stages/buildPython.groovy:buildDckr |
Python build lifecycle |
run |
src/com/meesho/stages/buildGradle.groovy:run |
Gradle build lifecycle |
buildDckr |
src/com/meesho/stages/buildRust.groovy:buildDckr |
Rust build lifecycle |
retryDockerPush |
src/com/meesho/utilities/dockerUtilities.groovy:retryDockerPush |
Docker push with retry |
getTag |
src/com/meesho/utilities/getDockerParams.groovy:getTag |
Image tag: v{version}-{sha}-{epoch} |
Sharp edges
python-3.10.12is aliased topython-3.7in Helm values:deployArgoCD.update_helm_reporemapspython-3.10.12→python-3.7for thedockerBuildVersionkey passed to the Helm template. Other python versions pass through as-is.- Maven multi-module builds:
getDockerParams.getModules()reads<modules>frompom.xml. If modules exist, a Docker image is built per module. - toolchain env Node builds include
TOOLCHAIN_ENVin the image path:${cicd_environment}/${TOOLCHAIN_ENV}/${team}/${repo}. Standard builds omit theTOOLCHAIN_ENVsegment. skip_s3_check=trueforces a fresh build even if an artifact already exists for the same commit.
Related concepts
- Build dispatch — regex routing to the correct builder
- Config-only detection — when builds are skipped
- Dockerfile templates — template rendering
- Docker tagging — tag format used by all builders
Notes
← Previous · Index · Next →