Started by timer Obtained Jenkinsfile from git https://github.com/DrPersico/postgresql.git [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in /var/jenkins_home/workspace/postgres-deploy [Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential f048d47c-1ea1-4dc6-b81c-f1ec032f0d77 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/postgres-deploy/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/DrPersico/postgresql.git # timeout=10 Fetching upstream changes from https://github.com/DrPersico/postgresql.git > git --version # timeout=10 > git --version # 'git version 2.47.3' using GIT_ASKPASS to set credentials Github > git fetch --tags --force --progress -- https://github.com/DrPersico/postgresql.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da (refs/remotes/origin/main) > git config core.sparsecheckout # timeout=10 > git checkout -f ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da # timeout=10 Commit message: "Fix backup container restart loop - add command separators" > git rev-list --no-walk ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da # timeout=10 [Pipeline] } [Pipeline] // stage [Pipeline] withEnv [Pipeline] { [Pipeline] withEnv [Pipeline] { [Pipeline] timeout Timeout set to expire in 20 min [Pipeline] { [Pipeline] timestamps [Pipeline] { [Pipeline] stage [Pipeline] { (Checkout) [Pipeline] script [Pipeline] { [Pipeline] cleanWs 02:45:11 [2025-11-21T02:45:11.437Z] [WS-CLEANUP] Deleting project workspace... 02:45:11 [2025-11-21T02:45:11.437Z] [WS-CLEANUP] Deferred wipeout is used... 02:45:11 [2025-11-21T02:45:11.582Z] [WS-CLEANUP] done [Pipeline] checkout 02:45:11 [2025-11-21T02:45:11.771Z] Selected Git installation does not exist. Using Default 02:45:11 [2025-11-21T02:45:11.771Z] The recommended git tool is: NONE 02:45:11 [2025-11-21T02:45:11.772Z] using credential f048d47c-1ea1-4dc6-b81c-f1ec032f0d77 02:45:11 [2025-11-21T02:45:11.794Z] Cloning the remote Git repository 02:45:11 [2025-11-21T02:45:11.794Z] Cloning repository https://github.com/DrPersico/postgresql.git 02:45:11 [2025-11-21T02:45:11.795Z] > git init /var/jenkins_home/workspace/postgres-deploy # timeout=10 02:45:11 [2025-11-21T02:45:11.833Z] Fetching upstream changes from https://github.com/DrPersico/postgresql.git 02:45:11 [2025-11-21T02:45:11.834Z] > git --version # timeout=10 02:45:11 [2025-11-21T02:45:11.846Z] > git --version # 'git version 2.47.3' 02:45:11 [2025-11-21T02:45:11.846Z] using GIT_ASKPASS to set credentials Github 02:45:11 [2025-11-21T02:45:11.897Z] > git fetch --tags --force --progress -- https://github.com/DrPersico/postgresql.git +refs/heads/*:refs/remotes/origin/* # timeout=10 02:45:13 [2025-11-21T02:45:13.250Z] > git config remote.origin.url https://github.com/DrPersico/postgresql.git # timeout=10 02:45:13 [2025-11-21T02:45:13.262Z] > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 02:45:13 [2025-11-21T02:45:13.280Z] Avoid second fetch 02:45:13 [2025-11-21T02:45:13.280Z] > git rev-parse refs/remotes/origin/main^{commit} # timeout=10 02:45:13 [2025-11-21T02:45:13.293Z] Checking out Revision ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da (refs/remotes/origin/main) 02:45:13 [2025-11-21T02:45:13.293Z] > git config core.sparsecheckout # timeout=10 02:45:13 [2025-11-21T02:45:13.304Z] > git checkout -f ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da # timeout=10 02:45:13 [2025-11-21T02:45:13.331Z] Commit message: "Fix backup container restart loop - add command separators" [Pipeline] echo 02:45:13 [2025-11-21T02:45:13.513Z] โœ… Code checked out successfully [Pipeline] pwd [Pipeline] echo 02:45:13 [2025-11-21T02:45:13.613Z] ๐Ÿ“‚ Working directory: /var/jenkins_home/workspace/postgres-deploy [Pipeline] echo 02:45:13 [2025-11-21T02:45:13.723Z] ๐ŸŒฟ Git branch: null [Pipeline] echo 02:45:13 [2025-11-21T02:45:13.788Z] ๐Ÿท๏ธ Git commit: ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Validate Configuration) [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:16 [2025-11-21T02:45:16.676Z] ๐Ÿ” Validating configuration files... [Pipeline] fileExists [Pipeline] echo 02:45:16 [2025-11-21T02:45:16.923Z] โœ… Found: docker-compose.yml [Pipeline] fileExists [Pipeline] echo 02:45:17 [2025-11-21T02:45:17.184Z] โœ… Found: postgresql/conf/postgresql.conf [Pipeline] fileExists [Pipeline] echo 02:45:17 [2025-11-21T02:45:17.412Z] โœ… Found: postgresql/conf/pg_hba.conf [Pipeline] fileExists [Pipeline] echo 02:45:17 [2025-11-21T02:45:17.573Z] โœ… Found: postgresql/init/01-init-database.sh [Pipeline] fileExists [Pipeline] echo 02:45:17 [2025-11-21T02:45:17.742Z] โœ… Found: .env.example [Pipeline] sh 02:45:18 [2025-11-21T02:45:18.046Z] + echo ๐Ÿณ Validating Docker Compose files... 02:45:18 [2025-11-21T02:45:18.046Z] ๐Ÿณ Validating Docker Compose files... 02:45:18 [2025-11-21T02:45:18.046Z] + docker-compose -f docker-compose.yml config --quiet 02:45:18 [2025-11-21T02:45:18.046Z] time="2025-11-21T02:45:17Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string." 02:45:18 [2025-11-21T02:45:18.046Z] time="2025-11-21T02:45:17Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string." [Pipeline] sh 02:45:18 [2025-11-21T02:45:18.386Z] + echo ๐Ÿ—„๏ธ Validating PostgreSQL configuration... 02:45:18 [2025-11-21T02:45:18.386Z] ๐Ÿ—„๏ธ Validating PostgreSQL configuration... 02:45:18 [2025-11-21T02:45:18.386Z] + grep -E ^(shared_buffers|effective_cache_size|work_mem) postgresql/conf/postgresql.conf 02:45:18 [2025-11-21T02:45:18.386Z] shared_buffers = 512MB # 25% of RAM 02:45:18 [2025-11-21T02:45:18.387Z] effective_cache_size = 2GB # 50% of RAM 02:45:18 [2025-11-21T02:45:18.387Z] work_mem = 8MB # Per connection [Pipeline] sh 02:45:18 [2025-11-21T02:45:18.732Z] + echo ๐Ÿ” Checking Jenkins credentials configuration... 02:45:18 [2025-11-21T02:45:18.733Z] ๐Ÿ” Checking Jenkins credentials configuration... 02:45:18 [2025-11-21T02:45:18.733Z] + echo โ„น๏ธ Note: Make sure you have configured these Jenkins credentials: 02:45:18 [2025-11-21T02:45:18.733Z] โ„น๏ธ Note: Make sure you have configured these Jenkins credentials: 02:45:18 [2025-11-21T02:45:18.733Z] + echo - postgres-password (Secret Text): Your PostgreSQL password 02:45:18 [2025-11-21T02:45:18.733Z] - postgres-password (Secret Text): Your PostgreSQL password 02:45:18 [2025-11-21T02:45:18.733Z] + echo - postgres-db (String, optional): Database name (default: postgres) 02:45:18 [2025-11-21T02:45:18.733Z] - postgres-db (String, optional): Database name (default: postgres) 02:45:18 [2025-11-21T02:45:18.733Z] + echo - postgres-user (String, optional): Database user (default: postgres) 02:45:18 [2025-11-21T02:45:18.733Z] - postgres-user (String, optional): Database user (default: postgres) 02:45:18 [2025-11-21T02:45:18.733Z] + echo ๐Ÿ“ Configure in: Jenkins โ†’ Manage Jenkins โ†’ Manage Credentials โ†’ (global) 02:45:18 [2025-11-21T02:45:18.734Z] ๐Ÿ“ Configure in: Jenkins โ†’ Manage Jenkins โ†’ Manage Credentials โ†’ (global) [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (System Health Check) [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:20 [2025-11-21T02:45:20.094Z] ๐Ÿ” Checking system resources... [Pipeline] sh 02:45:20 [2025-11-21T02:45:20.457Z] + docker info 02:45:20 [2025-11-21T02:45:20.709Z] + echo โœ… Docker is running 02:45:20 [2025-11-21T02:45:20.709Z] โœ… Docker is running 02:45:20 [2025-11-21T02:45:20.709Z] + echo ๐Ÿ’พ Memory information: 02:45:20 [2025-11-21T02:45:20.709Z] ๐Ÿ’พ Memory information: 02:45:20 [2025-11-21T02:45:20.709Z] + free -h 02:45:20 [2025-11-21T02:45:20.709Z] total used free shared buff/cache available 02:45:20 [2025-11-21T02:45:20.709Z] Mem: 7.6Gi 3.7Gi 918Mi 532Mi 3.8Gi 3.9Gi 02:45:20 [2025-11-21T02:45:20.709Z] Swap: 0B 0B 0B 02:45:20 [2025-11-21T02:45:20.709Z] + echo ๐Ÿ’ฟ Disk space: 02:45:20 [2025-11-21T02:45:20.709Z] ๐Ÿ’ฟ Disk space: 02:45:20 [2025-11-21T02:45:20.709Z] + df -h . 02:45:20 [2025-11-21T02:45:20.709Z] Filesystem Size Used Avail Use% Mounted on 02:45:20 [2025-11-21T02:45:20.709Z] /dev/mmcblk0p2 29G 18G 11G 63% /var/jenkins_home 02:45:20 [2025-11-21T02:45:20.709Z] + echo ๐Ÿ–ฅ๏ธ CPU information: 02:45:20 [2025-11-21T02:45:20.709Z] ๐Ÿ–ฅ๏ธ CPU information: 02:45:20 [2025-11-21T02:45:20.709Z] + nproc 02:45:20 [2025-11-21T02:45:20.710Z] 4 [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Deploy PostgreSQL) [Pipeline] echo 02:45:23 [2025-11-21T02:45:23.408Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:23 [2025-11-21T02:45:23.533Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:23 [2025-11-21T02:45:23.823Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:23 [2025-11-21T02:45:23.964Z] Warning, empty changelog. Have you run checkout? [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:24 [2025-11-21T02:45:24.372Z] ๐Ÿš€ Deploying PostgreSQL... [Pipeline] sh 02:45:24 [2025-11-21T02:45:24.695Z] + chmod +x postgresql/scripts/backup.sh postgresql/scripts/backup_check.sh postgresql/scripts/deploy.sh [Pipeline] withCredentials 02:45:25 [2025-11-21T02:45:25.083Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:45:25 [2025-11-21T02:45:25.485Z] + echo ๐Ÿ”ง Using Jenkins credentials for deployment... 02:45:25 [2025-11-21T02:45:25.485Z] ๐Ÿ”ง Using Jenkins credentials for deployment... 02:45:25 [2025-11-21T02:45:25.485Z] + export POSTGRES_DB=**** 02:45:25 [2025-11-21T02:45:25.485Z] + export POSTGRES_USER=**** 02:45:25 [2025-11-21T02:45:25.485Z] + export POSTGRES_PASSWORD=**** 02:45:25 [2025-11-21T02:45:25.485Z] + export PROJECT_NAME=Generic PostgreSQL 02:45:25 [2025-11-21T02:45:25.485Z] + export PROJECT_SCHEMA=none 02:45:25 [2025-11-21T02:45:25.486Z] + export JENKINS_WORKSPACE=/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:25 [2025-11-21T02:45:25.486Z] + echo ๐Ÿ“‹ Deployment configuration: 02:45:25 [2025-11-21T02:45:25.486Z] ๐Ÿ“‹ Deployment configuration: 02:45:25 [2025-11-21T02:45:25.486Z] + echo Database: **** 02:45:25 [2025-11-21T02:45:25.486Z] Database: **** 02:45:25 [2025-11-21T02:45:25.486Z] + echo User: **** 02:45:25 [2025-11-21T02:45:25.486Z] User: **** 02:45:25 [2025-11-21T02:45:25.486Z] + echo Project: Generic PostgreSQL 02:45:25 [2025-11-21T02:45:25.486Z] Project: Generic PostgreSQL 02:45:25 [2025-11-21T02:45:25.486Z] + echo Schema: none 02:45:25 [2025-11-21T02:45:25.486Z] Schema: none 02:45:25 [2025-11-21T02:45:25.486Z] + echo Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:25 [2025-11-21T02:45:25.487Z] Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:25 [2025-11-21T02:45:25.487Z] + echo Password: [REDACTED] 02:45:25 [2025-11-21T02:45:25.487Z] Password: [REDACTED] 02:45:25 [2025-11-21T02:45:25.487Z] + docker-compose -f docker-compose.yml down 02:45:25 [2025-11-21T02:45:25.487Z] Container datashield-backup Stopping 02:45:40 [2025-11-21T02:45:40.501Z] Container datashield-backup Stopped 02:45:40 [2025-11-21T02:45:40.501Z] Container datashield-backup Removing 02:45:40 [2025-11-21T02:45:40.501Z] Container datashield-backup Removed 02:45:40 [2025-11-21T02:45:40.501Z] Container ****-**** Stopping 02:45:42 [2025-11-21T02:45:42.368Z] Container ****-**** Stopped 02:45:42 [2025-11-21T02:45:42.369Z] Container ****-**** Removing 02:45:42 [2025-11-21T02:45:42.620Z] Container ****-**** Removed 02:45:42 [2025-11-21T02:45:42.620Z] Network ****-deploy_datashield-network Removing 02:45:42 [2025-11-21T02:45:42.620Z] Network ****-deploy_datashield-network Resource is still in use 02:45:42 [2025-11-21T02:45:42.621Z] + sed s/\${POSTGRES_DB}/****/g docker-compose.yml 02:45:42 [2025-11-21T02:45:42.621Z] + sed -i s/\${POSTGRES_USER}/****/g docker-compose.tmp.yml 02:45:42 [2025-11-21T02:45:42.621Z] + sed -i s/\${POSTGRES_PASSWORD}/****/g docker-compose.tmp.yml 02:45:42 [2025-11-21T02:45:42.621Z] + sed -i s/\${PROJECT_NAME}/Generic PostgreSQL/g docker-compose.tmp.yml 02:45:42 [2025-11-21T02:45:42.621Z] + sed -i s/\${PROJECT_SCHEMA}/none/g docker-compose.tmp.yml 02:45:42 [2025-11-21T02:45:42.621Z] + sed -i s|\${JENKINS_WORKSPACE:-./****ql}|/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql|g docker-compose.tmp.yml 02:45:42 [2025-11-21T02:45:42.622Z] + docker-compose -f docker-compose.tmp.yml up -d **** 02:45:42 [2025-11-21T02:45:42.873Z] Container ****-**** Creating 02:45:44 [2025-11-21T02:45:44.738Z] **** Your kernel does not support memory limit capabilities or the cgroup is not mounted. Limitation discarded. 02:45:44 [2025-11-21T02:45:44.738Z] **** Your kernel does not support memory soft limit capabilities or the cgroup is not mounted. Limitation discarded. 02:45:44 [2025-11-21T02:45:44.738Z] Container ****-**** Created 02:45:44 [2025-11-21T02:45:44.738Z] Container ****-**** Starting 02:45:45 [2025-11-21T02:45:45.293Z] Container ****-**** Started 02:45:45 [2025-11-21T02:45:45.293Z] + echo โณ Waiting for PostgreSQL to be ready... 02:45:45 [2025-11-21T02:45:45.293Z] โณ Waiting for PostgreSQL to be ready... 02:45:45 [2025-11-21T02:45:45.293Z] + docker exec ****-**** pg_isready -U **** -d **** 02:45:45 [2025-11-21T02:45:45.544Z] + echo โณ Waiting for PostgreSQL (attempt {1..60}/60)... 02:45:45 [2025-11-21T02:45:45.545Z] โณ Waiting for PostgreSQL (attempt {1..60}/60)... 02:45:45 [2025-11-21T02:45:45.545Z] + sleep 2 02:45:48 [2025-11-21T02:45:48.030Z] + docker exec ****-**** pg_isready -U **** -d **** 02:45:48 [2025-11-21T02:45:48.031Z] /var/run/****ql:5432 - accepting connections 02:45:48 [2025-11-21T02:45:48.031Z] + docker-compose -f docker-compose.tmp.yml up -d ****-backup 02:45:48 [2025-11-21T02:45:48.031Z] Container ****-**** Running 02:45:48 [2025-11-21T02:45:48.031Z] Container datashield-backup Creating 02:45:51 [2025-11-21T02:45:51.261Z] Container datashield-backup Created 02:45:51 [2025-11-21T02:45:51.261Z] Container ****-**** Waiting 02:45:51 [2025-11-21T02:45:51.512Z] Container ****-**** Healthy 02:45:51 [2025-11-21T02:45:51.512Z] Container datashield-backup Starting 02:45:52 [2025-11-21T02:45:52.424Z] Container datashield-backup Started 02:45:52 [2025-11-21T02:45:52.424Z] + rm docker-compose.tmp.yml [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:45:52 [2025-11-21T02:45:52.935Z] โœ… PostgreSQL deployed successfully [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Verify Deployment) [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:55 [2025-11-21T02:45:55.687Z] ๐Ÿ” Verifying deployment... [Pipeline] withCredentials 02:45:55 [2025-11-21T02:45:55.891Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:45:56 [2025-11-21T02:45:56.389Z] + export POSTGRES_DB=**** 02:45:56 [2025-11-21T02:45:56.389Z] + export POSTGRES_USER=**** 02:45:56 [2025-11-21T02:45:56.389Z] + export PGPASSWORD=**** 02:45:56 [2025-11-21T02:45:56.389Z] + echo ๐Ÿณ Container status: 02:45:56 [2025-11-21T02:45:56.389Z] ๐Ÿณ Container status: 02:45:56 [2025-11-21T02:45:56.390Z] + docker ps 02:45:56 [2025-11-21T02:45:56.390Z] + grep **** 02:45:56 [2025-11-21T02:45:56.390Z] 2d01d3e0a623 ****:18-alpine "docker-entrypoint.sโ€ฆ" 9 seconds ago Up 4 seconds 5432/tcp datashield-backup 02:45:56 [2025-11-21T02:45:56.391Z] 13f884756283 ****:18-alpine "docker-entrypoint.sโ€ฆ" 14 seconds ago Up 11 seconds (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp ****-**** 02:45:56 [2025-11-21T02:45:56.391Z] + echo ๐Ÿ”— Testing database connection... 02:45:56 [2025-11-21T02:45:56.391Z] ๐Ÿ”— Testing database connection... 02:45:56 [2025-11-21T02:45:56.391Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c SELECT 1 as connection_test; 02:45:56 [2025-11-21T02:45:56.944Z] connection_test 02:45:56 [2025-11-21T02:45:56.944Z] ----------------- 02:45:56 [2025-11-21T02:45:56.944Z] 1 02:45:56 [2025-11-21T02:45:56.944Z] (1 row) 02:45:56 [2025-11-21T02:45:56.944Z] 02:45:56 [2025-11-21T02:45:56.944Z] + echo ๐Ÿ“Š Database statistics: 02:45:56 [2025-11-21T02:45:56.944Z] ๐Ÿ“Š Database statistics: 02:45:56 [2025-11-21T02:45:56.944Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c 02:45:56 [2025-11-21T02:45:56.944Z] SELECT 02:45:56 [2025-11-21T02:45:56.944Z] 'total schemas' as check, 02:45:56 [2025-11-21T02:45:56.945Z] COUNT(*)::text as result 02:45:56 [2025-11-21T02:45:56.945Z] FROM information_schema.schemata 02:45:56 [2025-11-21T02:45:56.945Z] WHERE schema_name NOT IN ('information_schema', 'pg_catalog'); 02:45:56 [2025-11-21T02:45:56.945Z] 02:45:57 [2025-11-21T02:45:57.199Z] check | result 02:45:57 [2025-11-21T02:45:57.199Z] ---------------+-------- 02:45:57 [2025-11-21T02:45:57.199Z] total schemas | 2 02:45:57 [2025-11-21T02:45:57.199Z] (1 row) 02:45:57 [2025-11-21T02:45:57.199Z] 02:45:57 [2025-11-21T02:45:57.199Z] + echo ๐Ÿ’พ Testing backup system... 02:45:57 [2025-11-21T02:45:57.199Z] ๐Ÿ’พ Testing backup system... 02:45:57 [2025-11-21T02:45:57.199Z] + docker exec ****-backup /scripts/backup_check.sh 02:45:57 [2025-11-21T02:45:57.451Z] Error response from daemon: No such container: ****-backup 02:45:57 [2025-11-21T02:45:57.451Z] + echo โš ๏ธ Backup check not available (container might be starting) 02:45:57 [2025-11-21T02:45:57.451Z] โš ๏ธ Backup check not available (container might be starting) [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:45:58 [2025-11-21T02:45:58.218Z] โœ… Deployment verification completed [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Performance Test) [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:59 [2025-11-21T02:45:59.430Z] โšก Running performance tests... [Pipeline] withCredentials 02:45:59 [2025-11-21T02:45:59.616Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:46:00 [2025-11-21T02:46:00.037Z] + export POSTGRES_DB=**** 02:46:00 [2025-11-21T02:46:00.037Z] + export POSTGRES_USER=**** 02:46:00 [2025-11-21T02:46:00.037Z] + export PGPASSWORD=**** 02:46:00 [2025-11-21T02:46:00.038Z] + echo ๐Ÿ“ˆ Running basic performance queries... 02:46:00 [2025-11-21T02:46:00.038Z] ๐Ÿ“ˆ Running basic performance queries... 02:46:00 [2025-11-21T02:46:00.038Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c 02:46:00 [2025-11-21T02:46:00.038Z] -- Test basic query performance 02:46:00 [2025-11-21T02:46:00.038Z] EXPLAIN ANALYZE SELECT 1 as test_query; 02:46:00 [2025-11-21T02:46:00.038Z] 02:46:00 [2025-11-21T02:46:00.038Z] -- Test system catalog performance 02:46:00 [2025-11-21T02:46:00.038Z] EXPLAIN ANALYZE SELECT COUNT(*) FROM information_schema.tables; 02:46:00 [2025-11-21T02:46:00.038Z] 02:46:00 [2025-11-21T02:46:00.038Z] -- Test connection info 02:46:00 [2025-11-21T02:46:00.038Z] SELECT database_name, process_count FROM ( 02:46:00 [2025-11-21T02:46:00.039Z] SELECT datname as database_name, COUNT(*) as process_count 02:46:00 [2025-11-21T02:46:00.039Z] FROM pg_stat_activity 02:46:00 [2025-11-21T02:46:00.039Z] GROUP BY datname 02:46:00 [2025-11-21T02:46:00.039Z] ) as activity_stats; 02:46:00 [2025-11-21T02:46:00.039Z] 02:46:00 [2025-11-21T02:46:00.290Z] QUERY PLAN 02:46:00 [2025-11-21T02:46:00.290Z] --------------------------------------------------------------------------------------- 02:46:00 [2025-11-21T02:46:00.290Z] Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.006..0.012 rows=1.00 loops=1) 02:46:00 [2025-11-21T02:46:00.290Z] Planning: 02:46:00 [2025-11-21T02:46:00.290Z] Buffers: shared hit=3 02:46:00 [2025-11-21T02:46:00.290Z] Planning Time: 0.233 ms 02:46:00 [2025-11-21T02:46:00.290Z] Execution Time: 0.160 ms 02:46:00 [2025-11-21T02:46:00.290Z] (5 rows) 02:46:00 [2025-11-21T02:46:00.290Z] 02:46:00 [2025-11-21T02:46:00.291Z] QUERY PLAN 02:46:00 [2025-11-21T02:46:00.291Z] -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 02:46:00 [2025-11-21T02:46:00.291Z] Aggregate (cost=71.97..71.98 rows=1 width=8) (actual time=12.860..13.064 rows=1.00 loops=1) 02:46:00 [2025-11-21T02:46:00.291Z] Buffers: shared hit=28 read=12 02:46:00 [2025-11-21T02:46:00.291Z] -> Hash Left Join (cost=36.66..71.69 rows=112 width=0) (actual time=8.708..12.487 rows=215.00 loops=1) 02:46:00 [2025-11-21T02:46:00.291Z] Hash Cond: (c.reloftype = t.oid) 02:46:00 [2025-11-21T02:46:00.291Z] Buffers: shared hit=28 read=12 02:46:00 [2025-11-21T02:46:00.291Z] -> Hash Join (cost=1.09..34.58 rows=112 width=4) (actual time=0.733..3.171 rows=215.00 loops=1) 02:46:00 [2025-11-21T02:46:00.291Z] Hash Cond: (c.relnamespace = nc.oid) 02:46:00 [2025-11-21T02:46:00.292Z] Buffers: shared hit=22 read=1 02:46:00 [2025-11-21T02:46:00.292Z] -> Seq Scan on pg_class c (cost=0.00..32.67 rows=150 width=8) (actual time=0.115..1.366 rows=215.00 loops=1) 02:46:00 [2025-11-21T02:46:00.292Z] Filter: ((relkind = ANY ('{r,v,f,p}'::"char"[])) AND (pg_has_role(relowner, 'USAGE'::text) OR has_table_privilege(oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text) OR has_any_column_privilege(oid, 'SELECT, INSERT, UPDATE, REFERENCES'::text))) 02:46:00 [2025-11-21T02:46:00.292Z] Rows Removed by Filter: 202 02:46:00 [2025-11-21T02:46:00.292Z] Buffers: shared hit=13 read=1 02:46:00 [2025-11-21T02:46:00.292Z] -> Hash (cost=1.05..1.05 rows=3 width=4) (actual time=0.511..0.521 rows=4.00 loops=1) 02:46:00 [2025-11-21T02:46:00.292Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB 02:46:00 [2025-11-21T02:46:00.292Z] Buffers: shared hit=9 02:46:00 [2025-11-21T02:46:00.292Z] -> Seq Scan on pg_namespace nc (cost=0.00..1.05 rows=3 width=4) (actual time=0.189..0.451 rows=4.00 loops=1) 02:46:00 [2025-11-21T02:46:00.293Z] Filter: (NOT pg_is_other_temp_schema(oid)) 02:46:00 [2025-11-21T02:46:00.293Z] Buffers: shared hit=9 02:46:00 [2025-11-21T02:46:00.293Z] -> Hash (cost=27.29..27.29 rows=662 width=4) (actual time=7.886..7.909 rows=639.00 loops=1) 02:46:00 [2025-11-21T02:46:00.293Z] Buckets: 1024 Batches: 1 Memory Usage: 31kB 02:46:00 [2025-11-21T02:46:00.293Z] Buffers: shared hit=6 read=11 02:46:00 [2025-11-21T02:46:00.293Z] -> Hash Join (cost=1.09..27.29 rows=662 width=4) (actual time=0.307..5.861 rows=639.00 loops=1) 02:46:00 [2025-11-21T02:46:00.293Z] Hash Cond: (t.typnamespace = nt.oid) 02:46:00 [2025-11-21T02:46:00.293Z] Buffers: shared hit=6 read=11 02:46:00 [2025-11-21T02:46:00.293Z] -> Seq Scan on pg_type t (cost=0.00..22.62 rows=662 width=8) (actual time=0.091..2.002 rows=639.00 loops=1) 02:46:00 [2025-11-21T02:46:00.293Z] Buffers: shared hit=5 read=11 02:46:00 [2025-11-21T02:46:00.293Z] -> Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.157..0.165 rows=4.00 loops=1) 02:46:00 [2025-11-21T02:46:00.293Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB 02:46:00 [2025-11-21T02:46:00.294Z] Buffers: shared hit=1 02:46:00 [2025-11-21T02:46:00.294Z] -> Seq Scan on pg_namespace nt (cost=0.00..1.04 rows=4 width=4) (actual time=0.093..0.108 rows=4.00 loops=1) 02:46:00 [2025-11-21T02:46:00.294Z] Buffers: shared hit=1 02:46:00 [2025-11-21T02:46:00.294Z] Planning: 02:46:00 [2025-11-21T02:46:00.294Z] Buffers: shared hit=332 read=14 02:46:00 [2025-11-21T02:46:00.294Z] Planning Time: 15.759 ms 02:46:00 [2025-11-21T02:46:00.294Z] Execution Time: 14.839 ms 02:46:00 [2025-11-21T02:46:00.294Z] (35 rows) 02:46:00 [2025-11-21T02:46:00.294Z] 02:46:00 [2025-11-21T02:46:00.294Z] database_name | process_count 02:46:00 [2025-11-21T02:46:00.294Z] ---------------+--------------- 02:46:00 [2025-11-21T02:46:00.294Z] | 8 02:46:00 [2025-11-21T02:46:00.294Z] **** | 1 02:46:00 [2025-11-21T02:46:00.294Z] authentik | 5 02:46:00 [2025-11-21T02:46:00.294Z] (3 rows) 02:46:00 [2025-11-21T02:46:00.294Z] [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:46:02 [2025-11-21T02:46:02.123Z] โœ… Performance tests completed [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Create Backup) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:02 [2025-11-21T02:46:02.926Z] ๐Ÿ’พ Creating deployment backup: jenkins_backup_20251121_024602.sql [Pipeline] withCredentials 02:46:03 [2025-11-21T02:46:03.090Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:46:03 [2025-11-21T02:46:03.248Z] Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure. 02:46:03 [2025-11-21T02:46:03.249Z] Affected argument(s) used the following variable(s): [POSTGRES_DB] 02:46:03 [2025-11-21T02:46:03.249Z] See https://jenkins.io/redirect/groovy-string-interpolation for details. 02:46:03 [2025-11-21T02:46:03.510Z] + export POSTGRES_DB=**** 02:46:03 [2025-11-21T02:46:03.510Z] + export POSTGRES_USER=**** 02:46:03 [2025-11-21T02:46:03.510Z] + export PGPASSWORD=**** 02:46:03 [2025-11-21T02:46:03.510Z] + mkdir -p jenkins_backups 02:46:03 [2025-11-21T02:46:03.510Z] + docker exec -e PGPASSWORD=**** ****-**** pg_dump -h localhost -U **** -d **** --format=custom --compress=9 --file=/tmp/jenkins_backup_20251121_024602.sql 02:46:04 [2025-11-21T02:46:04.422Z] + docker cp ****-****:/tmp/jenkins_backup_20251121_024602.sql jenkins_backups/ 02:46:04 [2025-11-21T02:46:04.422Z] + cd jenkins_backups 02:46:04 [2025-11-21T02:46:04.422Z] + sha256sum jenkins_backup_20251121_024602.sql 02:46:04 [2025-11-21T02:46:04.422Z] + echo โœ… Backup created: jenkins_backup_20251121_024602.sql 02:46:04 [2025-11-21T02:46:04.423Z] โœ… Backup created: jenkins_backup_20251121_024602.sql 02:46:04 [2025-11-21T02:46:04.423Z] + ls -lh jenkins_backup_20251121_024602.sql 02:46:04 [2025-11-21T02:46:04.423Z] -rw-r--r-- 1 root root 6.9K Nov 21 02:46 jenkins_backup_20251121_024602.sql [Pipeline] } [Pipeline] // withCredentials [Pipeline] archiveArtifacts 02:46:04 [2025-11-21T02:46:04.816Z] Archiving artifacts 02:46:04 [2025-11-21T02:46:04.820Z] Recording fingerprints [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Declarative: Post Actions) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:05 [2025-11-21T02:46:05.893Z] ๐Ÿ“‹ Pipeline completed with status: SUCCESS [Pipeline] echo 02:46:06 [2025-11-21T02:46:06.722Z] 02:46:06 [2025-11-21T02:46:06.723Z] ๐ŸŽฏ PostgreSQL Deployment Pipeline 02:46:06 [2025-11-21T02:46:06.723Z] ๐Ÿ“… Build: 27 02:46:06 [2025-11-21T02:46:06.723Z] ๐ŸŒฟ Branch: null 02:46:06 [2025-11-21T02:46:06.723Z] ๐Ÿท๏ธ Commit: ade1f21b 02:46:06 [2025-11-21T02:46:06.723Z] โฑ๏ธ Duration: 1 min 5 sec and counting 02:46:06 [2025-11-21T02:46:06.723Z] โœ… Status: SUCCESS 02:46:06 [2025-11-21T02:46:06.723Z] [Pipeline] sh 02:46:07 [2025-11-21T02:46:07.371Z] + + findsort jenkins_backups -r -name 02:46:07 [2025-11-21T02:46:07.371Z] *.sql -type f 02:46:07 [2025-11-21T02:46:07.371Z] + tail -n +6 02:46:07 [2025-11-21T02:46:07.371Z] + xargs rm -f [Pipeline] } [Pipeline] // script [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:07 [2025-11-21T02:46:07.972Z] ๐ŸŽ‰ PostgreSQL deployment successful! [Pipeline] } [Pipeline] // script [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:08 [2025-11-21T02:46:08.494Z] ๐Ÿงน Cleaning up workspace... [Pipeline] sh 02:46:08 [2025-11-21T02:46:08.875Z] + rm -f *.tmp [Pipeline] echo 02:46:08 [2025-11-21T02:46:08.979Z] โœ… Keeping containers running for automated backups (main branch or production) [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // timestamps [Pipeline] } [Pipeline] // timeout [Pipeline] } [Pipeline] // withEnv [Pipeline] } [Pipeline] // withEnv [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS