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.
backup-restore.sh provides three operations — backup, restore, and list — to protect all service configurations, pipeline definitions, and databases across the full stack. Run it before upgrades, major configuration changes, migrations, or any destructive operation to ensure you have a clean recovery point.
What Gets Backed Up
A singlebackup invocation captures the current state of every service in the stack:
- Environment configurations — the entire
config/environments/directory tree, including allapplication.properties,database.properties, andsettings.xmlfiles fordev,staging, andprod - WildFly standalone configuration —
/opt/jboss/wildfly/standalone/configurationarchived from within the running container - JBoss standalone configuration —
/opt/jboss/wildfly/standalone/configurationarchived from within the running JBoss container - Jenkins jobs —
/var/jenkins_home/jobsincluding all pipeline definitions and build history - Jenkins credentials —
credentials.xmland thesecretsdirectory for stored credentials and encryption keys - Nexus configuration —
/nexus-data/etccontaining repository and security configuration - SonarQube database — a full PostgreSQL dump of the
sonarqubedatabase produced bypg_dump - Build configuration files —
build-config.yml,docker-compose.yml, and allJenkinsfile*variants
manifest.txt is generated inside each backup directory recording the timestamp, hostname, user, and a snapshot of running container statuses at backup time.
Commands
Create a backup
./backups/, copies all component data into it, then compresses the entire directory into a single tarball. On completion it prints the backup file path and its size:
List backups
Restore from a backup
Backup Location
Backups are written to:YYYYMMDD_HHMMSS (e.g., 20251025_143022). Each tarball contains the full backup directory at that timestamp, including the manifest.txt and all component archives.
Recommended Schedule
Automate backups with cron to match the risk profile of each environment:| Environment | Frequency | Cron Schedule |
|---|---|---|
| Development | Daily | 0 2 * * * cd /path/to/CICD && ./backup-restore.sh backup |
| Staging | Weekly | 0 2 * * 0 cd /path/to/CICD && ./backup-restore.sh backup |
| Production | Before each deployment | Run manually before every deployment |
Restoring a Backup
Stop services (optional)
For a clean restore, stop the stack before overwriting configuration:You can skip this step if you prefer an in-place restore, but restarting services afterward is still required.
What the Script Does During Restore
The restore process works component-by-component, skipping any component whose backup file is absent or whose container is not currently running:- Environment configurations — copied from the backup directory back to
config/environments/usingcp -r - Build configuration —
build-config.ymlis copied back to the project root - WildFly configuration — the
wildfly-config.tar.gzarchive is copied into the running container viadocker cp, then extracted withtar xzfand the container is restarted withdocker restart wildfly - JBoss configuration — same process as WildFly using the
jboss-config.tar.gzarchive anddocker restart jboss - Jenkins jobs —
jenkins-jobs.tar.gzis copied into the Jenkins container, extracted withtar xzf, and the container is restarted withdocker restart jenkins - SonarQube database —
sonarqube.sqlis fed into PostgreSQL viapsql -U sonar sonarqube, and the SonarQube container is restarted withdocker restart sonarqube
