Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/infra-neo/CICD/llms.txt

Use this file to discover all available pages before exploring further.

The CI/CD stack uses a layered environment variable strategy. Container-level variables — JVM options, database connection strings, and admin credentials — are declared in docker-compose.yml and applied at container startup. Pipeline-level variables are set in the environment {} block of the Jenkinsfile and are available to every stage. Application secrets such as database passwords and API keys must never be hardcoded in either location; instead they are stored as Jenkins Credentials and injected at runtime via withCredentials(). This page is the complete reference for all variables across every layer.

Jenkins Container Variables

These variables are set in the jenkins service’s environment block in docker-compose.yml.
VariableDefaultDescription
JAVA_OPTS-Djenkins.install.runSetupWizard=falseJVM options passed to the Jenkins process. The default disables the first-run setup wizard so that Groovy init scripts handle all configuration automatically. Append heap flags (e.g. -Xmx4096m -Xms2048m) here for memory tuning.

SonarQube Container Variables

These variables are set in the sonarqube service’s environment block in docker-compose.yml.
VariableDefaultDescription
SONAR_JDBC_URLjdbc:postgresql://postgres:5432/sonarqubeFull JDBC connection string pointing at the internal PostgreSQL service. The hostname postgres resolves within the cicd-network Docker bridge.
SONAR_JDBC_USERNAMEsonarDatabase user that SonarQube uses to connect to PostgreSQL. Must match POSTGRES_USER.
SONAR_JDBC_PASSWORDsonarPassword for the SonarQube database user. Must match POSTGRES_PASSWORD.
The following variables are not set in the base docker-compose.yml but can be added via docker-compose.override.yml to tune JVM memory for production workloads:
VariableExample ValueDescription
SONAR_CE_JAVAOPTS-Xmx2048m -Xms1024mJVM options for the SonarQube Compute Engine background process.
SONAR_WEB_JAVAOPTS-Xmx2048m -Xms1024mJVM options for the SonarQube web server process.

Nexus Container Variables

These variables are set in the nexus service’s environment block in docker-compose.yml.
VariableDefaultDescription
INSTALL4J_ADD_VM_PARAMS-Xms512m -Xmx512m -XX:MaxDirectMemorySize=273mJVM heap and direct memory settings for the Nexus process. The defaults are conservative; increase for repositories serving large binary artifacts or high concurrent load.

WildFly and JBoss Container Variables

These variables are set in the wildfly and jboss service blocks respectively.
VariableDefault (WildFly / JBoss)Description
WILDFLY_USER / JBOSS_USERadminManagement console username created by add-user.sh during setup.
WILDFLY_PASS / JBOSS_PASSadminManagement console password created by add-user.sh during setup.

PostgreSQL Container Variables

These variables are set in the postgres service’s environment block. PostgreSQL is an internal service and is not exposed outside the Docker network.
VariableDefaultDescription
POSTGRES_USERsonarDatabase superuser created on first container start. Must match SONAR_JDBC_USERNAME in the SonarQube service.
POSTGRES_PASSWORDsonarPassword for POSTGRES_USER. Must match SONAR_JDBC_PASSWORD in the SonarQube service.
POSTGRES_DBsonarqubeName of the database created on first start. Referenced in SONAR_JDBC_URL.

Jenkins Pipeline Variables

Pipeline-level variables are declared in the environment {} block of the Jenkinsfile and are available as environment variables within every stage. The following variables are used by the included pipeline:
VariableExample ValueDescription
NEXUS_URLhttp://nexus:8081Base URL of the Nexus service, resolved by the internal Docker network hostname.
SONARQUBE_URLhttp://sonarqube:9000Base URL of the SonarQube service used by the sonar:sonar Maven goal.
BUILD_CONFIGbuild-config.ymlPath to the YAML file loaded by the pipeline’s Read Build Config stage.
WILDFLY_URLhttp://wildfly:9990WildFly management API endpoint used for deployment steps.
JBOSS_URLhttp://jboss:9990JBoss management API endpoint used for deployment steps.
APP_VERSION(set dynamically)Set at runtime by the pipeline using the format ${BUILD_NUMBER}-${TIMESTAMP} as defined in build-config.yml. Embedded in artifact filenames and stored with versioned properties in Nexus.

Application-Level Secret Variables

Sensitive values such as database passwords, API keys, and deployment credentials must be stored as Jenkins Credentials and never hardcoded in source files or committed to Git. Jenkins provides the withCredentials() step to inject credential values as temporary environment variables scoped to a single block. Store Nexus credentials under the ID nexus-credentials (type: Username with password) in Jenkins at Manage Jenkins → Credentials. Reference them in a pipeline stage like this:
withCredentials([usernamePassword(credentialsId: 'nexus-credentials',
                                  usernameVariable: 'NEXUS_USER',
                                  passwordVariable: 'NEXUS_PASS')]) {
    sh "mvn deploy -DaltDeploymentRepository=nexus::default::${NEXUS_URL}/repository/maven-snapshots"
}
The values bound to NEXUS_USER and NEXUS_PASS are automatically masked in Jenkins console output and log files. They are never written to disk or exposed in the pipeline definition.
Never commit passwords, tokens, or API keys to Git — even in .env files or commented-out code. Jenkins Credentials (backed by the encrypted credentials store) and the withCredentials() step are the only approved patterns for secret injection. The build-config.yml security.enforce_env_vars flag is set to true by default to reinforce this policy.

Using a .env File

Docker Compose automatically reads a .env file in the same directory as docker-compose.yml and substitutes variable references in the Compose file. This is useful for overriding default port bindings or image version tags without editing the base file directly. Create a .env file in the project root:
# Image versions
JENKINS_VERSION=lts
SONARQUBE_VERSION=community
NEXUS_VERSION=latest
POSTGRES_VERSION=13

# Port overrides
JENKINS_PORT=8080
SONARQUBE_PORT=9000
NEXUS_PORT=8081
Reference the variables in docker-compose.yml using ${VAR:-default} syntax:
services:
  jenkins:
    image: jenkins/jenkins:${JENKINS_VERSION:-lts}
    ports:
      - "${JENKINS_PORT:-8080}:8080"
The .env file should be listed in .gitignore when it contains any environment-specific overrides. Use docker-compose.override.yml for structural changes (resource limits, health checks, volume bind mounts) and .env for simple scalar overrides like ports and version tags.

Build docs developers (and LLMs) love