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:12 [2025-11-23T02:45:12.741Z] [WS-CLEANUP] Deleting project workspace... 02:45:12 [2025-11-23T02:45:12.741Z] [WS-CLEANUP] Deferred wipeout is used... 02:45:12 [2025-11-23T02:45:12.787Z] [WS-CLEANUP] done [Pipeline] checkout 02:45:13 [2025-11-23T02:45:13.023Z] Selected Git installation does not exist. Using Default 02:45:13 [2025-11-23T02:45:13.023Z] The recommended git tool is: NONE 02:45:13 [2025-11-23T02:45:13.025Z] using credential f048d47c-1ea1-4dc6-b81c-f1ec032f0d77 02:45:13 [2025-11-23T02:45:13.084Z] Cloning the remote Git repository 02:45:13 [2025-11-23T02:45:13.085Z] Cloning repository https://github.com/DrPersico/postgresql.git 02:45:13 [2025-11-23T02:45:13.085Z] > git init /var/jenkins_home/workspace/postgres-deploy # timeout=10 02:45:13 [2025-11-23T02:45:13.159Z] Fetching upstream changes from https://github.com/DrPersico/postgresql.git 02:45:13 [2025-11-23T02:45:13.159Z] > git --version # timeout=10 02:45:13 [2025-11-23T02:45:13.173Z] > git --version # 'git version 2.47.3' 02:45:13 [2025-11-23T02:45:13.173Z] using GIT_ASKPASS to set credentials Github 02:45:13 [2025-11-23T02:45:13.196Z] > git fetch --tags --force --progress -- https://github.com/DrPersico/postgresql.git +refs/heads/*:refs/remotes/origin/* # timeout=10 02:45:14 [2025-11-23T02:45:14.281Z] > git config remote.origin.url https://github.com/DrPersico/postgresql.git # timeout=10 02:45:14 [2025-11-23T02:45:14.291Z] > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 02:45:14 [2025-11-23T02:45:14.312Z] Avoid second fetch 02:45:14 [2025-11-23T02:45:14.312Z] > git rev-parse refs/remotes/origin/main^{commit} # timeout=10 02:45:14 [2025-11-23T02:45:14.324Z] Checking out Revision ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da (refs/remotes/origin/main) 02:45:14 [2025-11-23T02:45:14.325Z] > git config core.sparsecheckout # timeout=10 02:45:14 [2025-11-23T02:45:14.334Z] > git checkout -f ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da # timeout=10 02:45:14 [2025-11-23T02:45:14.359Z] Commit message: "Fix backup container restart loop - add command separators" [Pipeline] echo 02:45:14 [2025-11-23T02:45:14.496Z] โœ… Code checked out successfully [Pipeline] pwd [Pipeline] echo 02:45:14 [2025-11-23T02:45:14.658Z] ๐Ÿ“‚ Working directory: /var/jenkins_home/workspace/postgres-deploy [Pipeline] echo 02:45:14 [2025-11-23T02:45:14.779Z] ๐ŸŒฟ Git branch: null [Pipeline] echo 02:45:15 [2025-11-23T02:45:15.504Z] ๐Ÿท๏ธ Git commit: ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Validate Configuration) [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:18 [2025-11-23T02:45:18.424Z] ๐Ÿ” Validating configuration files... [Pipeline] fileExists [Pipeline] echo 02:45:18 [2025-11-23T02:45:18.685Z] โœ… Found: docker-compose.yml [Pipeline] fileExists [Pipeline] echo 02:45:19 [2025-11-23T02:45:19.000Z] โœ… Found: postgresql/conf/postgresql.conf [Pipeline] fileExists [Pipeline] echo 02:45:19 [2025-11-23T02:45:19.407Z] โœ… Found: postgresql/conf/pg_hba.conf [Pipeline] fileExists [Pipeline] echo 02:45:19 [2025-11-23T02:45:19.675Z] โœ… Found: postgresql/init/01-init-database.sh [Pipeline] fileExists [Pipeline] echo 02:45:19 [2025-11-23T02:45:19.932Z] โœ… Found: .env.example [Pipeline] sh 02:45:20 [2025-11-23T02:45:20.273Z] + echo ๐Ÿณ Validating Docker Compose files... 02:45:20 [2025-11-23T02:45:20.273Z] ๐Ÿณ Validating Docker Compose files... 02:45:20 [2025-11-23T02:45:20.273Z] + docker-compose -f docker-compose.yml config --quiet 02:45:20 [2025-11-23T02:45:20.273Z] time="2025-11-23T02:45:20Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string." 02:45:20 [2025-11-23T02:45:20.273Z] time="2025-11-23T02:45:20Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string." [Pipeline] sh 02:45:20 [2025-11-23T02:45:20.688Z] + echo ๐Ÿ—„๏ธ Validating PostgreSQL configuration... 02:45:20 [2025-11-23T02:45:20.688Z] ๐Ÿ—„๏ธ Validating PostgreSQL configuration... 02:45:20 [2025-11-23T02:45:20.688Z] + grep -E ^(shared_buffers|effective_cache_size|work_mem) postgresql/conf/postgresql.conf 02:45:20 [2025-11-23T02:45:20.688Z] shared_buffers = 512MB # 25% of RAM 02:45:20 [2025-11-23T02:45:20.688Z] effective_cache_size = 2GB # 50% of RAM 02:45:20 [2025-11-23T02:45:20.688Z] work_mem = 8MB # Per connection [Pipeline] sh 02:45:21 [2025-11-23T02:45:21.081Z] + echo ๐Ÿ” Checking Jenkins credentials configuration... 02:45:21 [2025-11-23T02:45:21.081Z] ๐Ÿ” Checking Jenkins credentials configuration... 02:45:21 [2025-11-23T02:45:21.081Z] + echo โ„น๏ธ Note: Make sure you have configured these Jenkins credentials: 02:45:21 [2025-11-23T02:45:21.081Z] โ„น๏ธ Note: Make sure you have configured these Jenkins credentials: 02:45:21 [2025-11-23T02:45:21.081Z] + echo - postgres-password (Secret Text): Your PostgreSQL password 02:45:21 [2025-11-23T02:45:21.081Z] - postgres-password (Secret Text): Your PostgreSQL password 02:45:21 [2025-11-23T02:45:21.081Z] + echo - postgres-db (String, optional): Database name (default: postgres) 02:45:21 [2025-11-23T02:45:21.081Z] - postgres-db (String, optional): Database name (default: postgres) 02:45:21 [2025-11-23T02:45:21.081Z] + echo - postgres-user (String, optional): Database user (default: postgres) 02:45:21 [2025-11-23T02:45:21.081Z] - postgres-user (String, optional): Database user (default: postgres) 02:45:21 [2025-11-23T02:45:21.081Z] + echo ๐Ÿ“ Configure in: Jenkins โ†’ Manage Jenkins โ†’ Manage Credentials โ†’ (global) 02:45:21 [2025-11-23T02:45:21.081Z] ๐Ÿ“ 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:23 [2025-11-23T02:45:23.670Z] ๐Ÿ” Checking system resources... [Pipeline] sh 02:45:24 [2025-11-23T02:45:24.020Z] + docker info 02:45:24 [2025-11-23T02:45:24.273Z] + echo โœ… Docker is running 02:45:24 [2025-11-23T02:45:24.273Z] โœ… Docker is running 02:45:24 [2025-11-23T02:45:24.273Z] + echo ๐Ÿ’พ Memory information: 02:45:24 [2025-11-23T02:45:24.273Z] ๐Ÿ’พ Memory information: 02:45:24 [2025-11-23T02:45:24.273Z] + free -h 02:45:24 [2025-11-23T02:45:24.273Z] total used free shared buff/cache available 02:45:24 [2025-11-23T02:45:24.273Z] Mem: 7.6Gi 4.0Gi 311Mi 656Mi 4.2Gi 3.6Gi 02:45:24 [2025-11-23T02:45:24.273Z] Swap: 0B 0B 0B 02:45:24 [2025-11-23T02:45:24.273Z] + echo ๐Ÿ’ฟ Disk space: 02:45:24 [2025-11-23T02:45:24.273Z] ๐Ÿ’ฟ Disk space: 02:45:24 [2025-11-23T02:45:24.273Z] + df -h . 02:45:24 [2025-11-23T02:45:24.273Z] Filesystem Size Used Avail Use% Mounted on 02:45:24 [2025-11-23T02:45:24.273Z] /dev/mmcblk0p2 29G 26G 1.9G 94% /var/jenkins_home 02:45:24 [2025-11-23T02:45:24.273Z] + echo ๐Ÿ–ฅ๏ธ CPU information: 02:45:24 [2025-11-23T02:45:24.273Z] ๐Ÿ–ฅ๏ธ CPU information: 02:45:24 [2025-11-23T02:45:24.273Z] + nproc 02:45:24 [2025-11-23T02:45:24.273Z] 4 [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Deploy PostgreSQL) [Pipeline] echo 02:45:25 [2025-11-23T02:45:25.674Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:25 [2025-11-23T02:45:25.816Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:26 [2025-11-23T02:45:26.168Z] Warning, empty changelog. Have you run checkout? [Pipeline] echo 02:45:26 [2025-11-23T02:45:26.363Z] Warning, empty changelog. Have you run checkout? [Pipeline] script [Pipeline] { [Pipeline] echo 02:45:26 [2025-11-23T02:45:26.968Z] ๐Ÿš€ Deploying PostgreSQL... [Pipeline] sh 02:45:27 [2025-11-23T02:45:27.305Z] + chmod +x postgresql/scripts/backup.sh postgresql/scripts/backup_check.sh postgresql/scripts/deploy.sh [Pipeline] withCredentials 02:45:27 [2025-11-23T02:45:27.752Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:45:28 [2025-11-23T02:45:28.210Z] + echo ๐Ÿ”ง Using Jenkins credentials for deployment... 02:45:28 [2025-11-23T02:45:28.211Z] ๐Ÿ”ง Using Jenkins credentials for deployment... 02:45:28 [2025-11-23T02:45:28.211Z] + export POSTGRES_DB=**** 02:45:28 [2025-11-23T02:45:28.211Z] + export POSTGRES_USER=**** 02:45:28 [2025-11-23T02:45:28.211Z] + export POSTGRES_PASSWORD=**** 02:45:28 [2025-11-23T02:45:28.211Z] + export PROJECT_NAME=Generic PostgreSQL 02:45:28 [2025-11-23T02:45:28.211Z] + export PROJECT_SCHEMA=none 02:45:28 [2025-11-23T02:45:28.211Z] + export JENKINS_WORKSPACE=/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:28 [2025-11-23T02:45:28.211Z] + echo ๐Ÿ“‹ Deployment configuration: 02:45:28 [2025-11-23T02:45:28.211Z] ๐Ÿ“‹ Deployment configuration: 02:45:28 [2025-11-23T02:45:28.211Z] + echo Database: **** 02:45:28 [2025-11-23T02:45:28.211Z] Database: **** 02:45:28 [2025-11-23T02:45:28.211Z] + echo User: **** 02:45:28 [2025-11-23T02:45:28.211Z] User: **** 02:45:28 [2025-11-23T02:45:28.211Z] + echo Project: Generic PostgreSQL 02:45:28 [2025-11-23T02:45:28.211Z] Project: Generic PostgreSQL 02:45:28 [2025-11-23T02:45:28.211Z] + echo Schema: none 02:45:28 [2025-11-23T02:45:28.211Z] Schema: none 02:45:28 [2025-11-23T02:45:28.212Z] + echo Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:28 [2025-11-23T02:45:28.212Z] Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql 02:45:28 [2025-11-23T02:45:28.212Z] + echo Password: [REDACTED] 02:45:28 [2025-11-23T02:45:28.212Z] Password: [REDACTED] 02:45:28 [2025-11-23T02:45:28.212Z] + docker-compose -f docker-compose.yml down 02:45:28 [2025-11-23T02:45:28.212Z] Container datashield-backup Stopping 02:45:40 [2025-11-23T02:45:40.316Z] Container datashield-backup Stopped 02:45:40 [2025-11-23T02:45:40.316Z] Container datashield-backup Removing 02:45:40 [2025-11-23T02:45:40.316Z] Container datashield-backup Removed 02:45:40 [2025-11-23T02:45:40.316Z] Container ****-**** Stopping 02:45:45 [2025-11-23T02:45:45.516Z] Container ****-**** Stopped 02:45:45 [2025-11-23T02:45:45.516Z] Container ****-**** Removing 02:45:45 [2025-11-23T02:45:45.516Z] Container ****-**** Removed 02:45:45 [2025-11-23T02:45:45.516Z] Network ****-deploy_datashield-network Removing 02:45:45 [2025-11-23T02:45:45.516Z] Network ****-deploy_datashield-network Resource is still in use 02:45:45 [2025-11-23T02:45:45.516Z] + sed s/\${POSTGRES_DB}/****/g docker-compose.yml 02:45:45 [2025-11-23T02:45:45.516Z] + sed -i s/\${POSTGRES_USER}/****/g docker-compose.tmp.yml 02:45:45 [2025-11-23T02:45:45.516Z] + sed -i s/\${POSTGRES_PASSWORD}/****/g docker-compose.tmp.yml 02:45:45 [2025-11-23T02:45:45.516Z] + sed -i s/\${PROJECT_NAME}/Generic PostgreSQL/g docker-compose.tmp.yml 02:45:45 [2025-11-23T02:45:45.516Z] + sed -i s/\${PROJECT_SCHEMA}/none/g docker-compose.tmp.yml 02:45:45 [2025-11-23T02:45:45.517Z] + sed -i s|\${JENKINS_WORKSPACE:-./****ql}|/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql|g docker-compose.tmp.yml 02:45:45 [2025-11-23T02:45:45.517Z] + docker-compose -f docker-compose.tmp.yml up -d **** 02:45:45 [2025-11-23T02:45:45.517Z] Container ****-**** Creating 02:45:50 [2025-11-23T02:45:50.717Z] **** Your kernel does not support memory limit capabilities or the cgroup is not mounted. Limitation discarded. 02:45:50 [2025-11-23T02:45:50.717Z] **** Your kernel does not support memory soft limit capabilities or the cgroup is not mounted. Limitation discarded. 02:45:50 [2025-11-23T02:45:50.717Z] Container ****-**** Created 02:45:50 [2025-11-23T02:45:50.717Z] Container ****-**** Starting 02:45:51 [2025-11-23T02:45:51.633Z] Container ****-**** Started 02:45:51 [2025-11-23T02:45:51.633Z] + echo โณ Waiting for PostgreSQL to be ready... 02:45:51 [2025-11-23T02:45:51.633Z] โณ Waiting for PostgreSQL to be ready... 02:45:51 [2025-11-23T02:45:51.633Z] + docker exec ****-**** pg_isready -U **** -d **** 02:45:51 [2025-11-23T02:45:51.633Z] + echo โณ Waiting for PostgreSQL (attempt {1..60}/60)... 02:45:51 [2025-11-23T02:45:51.634Z] โณ Waiting for PostgreSQL (attempt {1..60}/60)... 02:45:51 [2025-11-23T02:45:51.634Z] + sleep 2 02:45:54 [2025-11-23T02:45:54.121Z] + docker exec ****-**** pg_isready -U **** -d **** 02:45:54 [2025-11-23T02:45:54.121Z] /var/run/****ql:5432 - accepting connections 02:45:54 [2025-11-23T02:45:54.121Z] + docker-compose -f docker-compose.tmp.yml up -d ****-backup 02:45:54 [2025-11-23T02:45:54.121Z] Container ****-**** Running 02:45:54 [2025-11-23T02:45:54.121Z] Container datashield-backup Creating 02:45:58 [2025-11-23T02:45:58.248Z] Container datashield-backup Created 02:45:58 [2025-11-23T02:45:58.248Z] Container ****-**** Waiting 02:45:58 [2025-11-23T02:45:58.248Z] Container ****-**** Healthy 02:45:58 [2025-11-23T02:45:58.249Z] Container datashield-backup Starting 02:45:59 [2025-11-23T02:45:59.164Z] Container datashield-backup Started 02:45:59 [2025-11-23T02:45:59.164Z] + rm docker-compose.tmp.yml [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:45:59 [2025-11-23T02:45:59.549Z] โœ… PostgreSQL deployed successfully [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Verify Deployment) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:03 [2025-11-23T02:46:03.276Z] ๐Ÿ” Verifying deployment... [Pipeline] withCredentials 02:46:03 [2025-11-23T02:46:03.762Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:46:04 [2025-11-23T02:46:04.181Z] + export POSTGRES_DB=**** 02:46:04 [2025-11-23T02:46:04.181Z] + export POSTGRES_USER=**** 02:46:04 [2025-11-23T02:46:04.182Z] + export PGPASSWORD=**** 02:46:04 [2025-11-23T02:46:04.182Z] + echo ๐Ÿณ Container status: 02:46:04 [2025-11-23T02:46:04.182Z] ๐Ÿณ Container status: 02:46:04 [2025-11-23T02:46:04.182Z] + docker ps 02:46:04 [2025-11-23T02:46:04.182Z] + grep **** 02:46:04 [2025-11-23T02:46:04.188Z] 50e2fdea94c8 ****:18-alpine "docker-entrypoint.sโ€ฆ" 10 seconds ago Up 5 seconds 5432/tcp datashield-backup 02:46:04 [2025-11-23T02:46:04.188Z] 29e19ce6d66c ****:18-alpine "docker-entrypoint.sโ€ฆ" 20 seconds ago Up 13 seconds (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp ****-**** 02:46:04 [2025-11-23T02:46:04.188Z] + echo ๐Ÿ”— Testing database connection... 02:46:04 [2025-11-23T02:46:04.188Z] ๐Ÿ”— Testing database connection... 02:46:04 [2025-11-23T02:46:04.188Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c SELECT 1 as connection_test; 02:46:04 [2025-11-23T02:46:04.440Z] connection_test 02:46:04 [2025-11-23T02:46:04.440Z] ----------------- 02:46:04 [2025-11-23T02:46:04.440Z] 1 02:46:04 [2025-11-23T02:46:04.440Z] (1 row) 02:46:04 [2025-11-23T02:46:04.440Z] 02:46:04 [2025-11-23T02:46:04.693Z] + echo ๐Ÿ“Š Database statistics: 02:46:04 [2025-11-23T02:46:04.693Z] ๐Ÿ“Š Database statistics: 02:46:04 [2025-11-23T02:46:04.693Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c 02:46:04 [2025-11-23T02:46:04.693Z] SELECT 02:46:04 [2025-11-23T02:46:04.696Z] 'total schemas' as check, 02:46:04 [2025-11-23T02:46:04.696Z] COUNT(*)::text as result 02:46:04 [2025-11-23T02:46:04.696Z] FROM information_schema.schemata 02:46:04 [2025-11-23T02:46:04.696Z] WHERE schema_name NOT IN ('information_schema', 'pg_catalog'); 02:46:04 [2025-11-23T02:46:04.696Z] 02:46:04 [2025-11-23T02:46:04.947Z] check | result 02:46:04 [2025-11-23T02:46:04.947Z] ---------------+-------- 02:46:04 [2025-11-23T02:46:04.947Z] total schemas | 2 02:46:04 [2025-11-23T02:46:04.947Z] (1 row) 02:46:04 [2025-11-23T02:46:04.947Z] 02:46:04 [2025-11-23T02:46:04.948Z] + echo ๐Ÿ’พ Testing backup system... 02:46:04 [2025-11-23T02:46:04.948Z] ๐Ÿ’พ Testing backup system... 02:46:04 [2025-11-23T02:46:04.948Z] + docker exec ****-backup /scripts/backup_check.sh 02:46:04 [2025-11-23T02:46:04.948Z] Error response from daemon: No such container: ****-backup 02:46:04 [2025-11-23T02:46:04.948Z] + echo โš ๏ธ Backup check not available (container might be starting) 02:46:04 [2025-11-23T02:46:04.948Z] โš ๏ธ Backup check not available (container might be starting) [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:46:05 [2025-11-23T02:46:05.417Z] โœ… Deployment verification completed [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Performance Test) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:07 [2025-11-23T02:46:07.785Z] โšก Running performance tests... [Pipeline] withCredentials 02:46:08 [2025-11-23T02:46:08.514Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:46:08 [2025-11-23T02:46:08.922Z] + export POSTGRES_DB=**** 02:46:08 [2025-11-23T02:46:08.922Z] + export POSTGRES_USER=**** 02:46:08 [2025-11-23T02:46:08.922Z] + export PGPASSWORD=**** 02:46:08 [2025-11-23T02:46:08.923Z] + echo ๐Ÿ“ˆ Running basic performance queries... 02:46:08 [2025-11-23T02:46:08.923Z] ๐Ÿ“ˆ Running basic performance queries... 02:46:08 [2025-11-23T02:46:08.923Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c 02:46:08 [2025-11-23T02:46:08.923Z] -- Test basic query performance 02:46:08 [2025-11-23T02:46:08.923Z] EXPLAIN ANALYZE SELECT 1 as test_query; 02:46:08 [2025-11-23T02:46:08.923Z] 02:46:08 [2025-11-23T02:46:08.923Z] -- Test system catalog performance 02:46:08 [2025-11-23T02:46:08.923Z] EXPLAIN ANALYZE SELECT COUNT(*) FROM information_schema.tables; 02:46:08 [2025-11-23T02:46:08.923Z] 02:46:08 [2025-11-23T02:46:08.923Z] -- Test connection info 02:46:08 [2025-11-23T02:46:08.923Z] SELECT database_name, process_count FROM ( 02:46:08 [2025-11-23T02:46:08.923Z] SELECT datname as database_name, COUNT(*) as process_count 02:46:08 [2025-11-23T02:46:08.923Z] FROM pg_stat_activity 02:46:08 [2025-11-23T02:46:08.923Z] GROUP BY datname 02:46:08 [2025-11-23T02:46:08.923Z] ) as activity_stats; 02:46:08 [2025-11-23T02:46:08.923Z] 02:46:09 [2025-11-23T02:46:09.175Z] QUERY PLAN 02:46:09 [2025-11-23T02:46:09.175Z] --------------------------------------------------------------------------------------- 02:46:09 [2025-11-23T02:46:09.175Z] Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.004..0.008 rows=1.00 loops=1) 02:46:09 [2025-11-23T02:46:09.175Z] Planning: 02:46:09 [2025-11-23T02:46:09.175Z] Buffers: shared hit=3 02:46:09 [2025-11-23T02:46:09.175Z] Planning Time: 0.164 ms 02:46:09 [2025-11-23T02:46:09.175Z] Execution Time: 0.111 ms 02:46:09 [2025-11-23T02:46:09.175Z] (5 rows) 02:46:09 [2025-11-23T02:46:09.175Z] 02:46:09 [2025-11-23T02:46:09.175Z] QUERY PLAN 02:46:09 [2025-11-23T02:46:09.175Z] -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 02:46:09 [2025-11-23T02:46:09.175Z] Aggregate (cost=71.97..71.98 rows=1 width=8) (actual time=10.894..10.932 rows=1.00 loops=1) 02:46:09 [2025-11-23T02:46:09.176Z] Buffers: shared hit=28 read=12 02:46:09 [2025-11-23T02:46:09.176Z] -> Hash Left Join (cost=36.66..71.69 rows=112 width=0) (actual time=8.149..10.560 rows=215.00 loops=1) 02:46:09 [2025-11-23T02:46:09.176Z] Hash Cond: (c.reloftype = t.oid) 02:46:09 [2025-11-23T02:46:09.176Z] Buffers: shared hit=28 read=12 02:46:09 [2025-11-23T02:46:09.176Z] -> Hash Join (cost=1.09..34.58 rows=112 width=4) (actual time=0.627..2.363 rows=215.00 loops=1) 02:46:09 [2025-11-23T02:46:09.176Z] Hash Cond: (c.relnamespace = nc.oid) 02:46:09 [2025-11-23T02:46:09.176Z] Buffers: shared hit=22 read=1 02:46:09 [2025-11-23T02:46:09.176Z] -> Seq Scan on pg_class c (cost=0.00..32.67 rows=150 width=8) (actual time=0.085..1.070 rows=215.00 loops=1) 02:46:09 [2025-11-23T02:46:09.176Z] 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:09 [2025-11-23T02:46:09.176Z] Rows Removed by Filter: 202 02:46:09 [2025-11-23T02:46:09.176Z] Buffers: shared hit=13 read=1 02:46:09 [2025-11-23T02:46:09.176Z] -> Hash (cost=1.05..1.05 rows=3 width=4) (actual time=0.480..0.485 rows=4.00 loops=1) 02:46:09 [2025-11-23T02:46:09.177Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB 02:46:09 [2025-11-23T02:46:09.177Z] Buffers: shared hit=9 02:46:09 [2025-11-23T02:46:09.177Z] -> Seq Scan on pg_namespace nc (cost=0.00..1.05 rows=3 width=4) (actual time=0.241..0.423 rows=4.00 loops=1) 02:46:09 [2025-11-23T02:46:09.177Z] Filter: (NOT pg_is_other_temp_schema(oid)) 02:46:09 [2025-11-23T02:46:09.177Z] Buffers: shared hit=9 02:46:09 [2025-11-23T02:46:09.177Z] -> Hash (cost=27.29..27.29 rows=662 width=4) (actual time=7.468..7.483 rows=639.00 loops=1) 02:46:09 [2025-11-23T02:46:09.177Z] Buckets: 1024 Batches: 1 Memory Usage: 31kB 02:46:09 [2025-11-23T02:46:09.177Z] Buffers: shared hit=6 read=11 02:46:09 [2025-11-23T02:46:09.177Z] -> Hash Join (cost=1.09..27.29 rows=662 width=4) (actual time=0.210..6.041 rows=639.00 loops=1) 02:46:09 [2025-11-23T02:46:09.177Z] Hash Cond: (t.typnamespace = nt.oid) 02:46:09 [2025-11-23T02:46:09.177Z] Buffers: shared hit=6 read=11 02:46:09 [2025-11-23T02:46:09.177Z] -> Seq Scan on pg_type t (cost=0.00..22.62 rows=662 width=8) (actual time=0.057..3.595 rows=639.00 loops=1) 02:46:09 [2025-11-23T02:46:09.177Z] Buffers: shared hit=5 read=11 02:46:09 [2025-11-23T02:46:09.178Z] -> Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.099..0.105 rows=4.00 loops=1) 02:46:09 [2025-11-23T02:46:09.178Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB 02:46:09 [2025-11-23T02:46:09.178Z] Buffers: shared hit=1 02:46:09 [2025-11-23T02:46:09.178Z] -> Seq Scan on pg_namespace nt (cost=0.00..1.04 rows=4 width=4) (actual time=0.058..0.068 rows=4.00 loops=1) 02:46:09 [2025-11-23T02:46:09.178Z] Buffers: shared hit=1 02:46:09 [2025-11-23T02:46:09.178Z] Planning: 02:46:09 [2025-11-23T02:46:09.178Z] Buffers: shared hit=332 read=14 02:46:09 [2025-11-23T02:46:09.178Z] Planning Time: 19.995 ms 02:46:09 [2025-11-23T02:46:09.178Z] Execution Time: 12.249 ms 02:46:09 [2025-11-23T02:46:09.178Z] (35 rows) 02:46:09 [2025-11-23T02:46:09.178Z] 02:46:09 [2025-11-23T02:46:09.178Z] database_name | process_count 02:46:09 [2025-11-23T02:46:09.178Z] ---------------+--------------- 02:46:09 [2025-11-23T02:46:09.178Z] | 8 02:46:09 [2025-11-23T02:46:09.178Z] **** | 1 02:46:09 [2025-11-23T02:46:09.178Z] authentik | 6 02:46:09 [2025-11-23T02:46:09.178Z] (3 rows) 02:46:09 [2025-11-23T02:46:09.178Z] [Pipeline] } [Pipeline] // withCredentials [Pipeline] echo 02:46:09 [2025-11-23T02:46:09.490Z] โœ… Performance tests completed [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Create Backup) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:10 [2025-11-23T02:46:10.410Z] ๐Ÿ’พ Creating deployment backup: jenkins_backup_20251123_024610.sql [Pipeline] withCredentials 02:46:10 [2025-11-23T02:46:10.691Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER [Pipeline] { [Pipeline] sh 02:46:10 [2025-11-23T02:46:10.974Z] Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure. 02:46:10 [2025-11-23T02:46:10.974Z] Affected argument(s) used the following variable(s): [POSTGRES_DB] 02:46:10 [2025-11-23T02:46:10.974Z] See https://jenkins.io/redirect/groovy-string-interpolation for details. 02:46:11 [2025-11-23T02:46:11.239Z] + export POSTGRES_DB=**** 02:46:11 [2025-11-23T02:46:11.239Z] + export POSTGRES_USER=**** 02:46:11 [2025-11-23T02:46:11.239Z] + export PGPASSWORD=**** 02:46:11 [2025-11-23T02:46:11.239Z] + mkdir -p jenkins_backups 02:46:11 [2025-11-23T02:46:11.240Z] + docker exec -e PGPASSWORD=**** ****-**** pg_dump -h localhost -U **** -d **** --format=custom --compress=9 --file=/tmp/jenkins_backup_20251123_024610.sql 02:46:12 [2025-11-23T02:46:12.152Z] + docker cp ****-****:/tmp/jenkins_backup_20251123_024610.sql jenkins_backups/ 02:46:12 [2025-11-23T02:46:12.404Z] + cd jenkins_backups 02:46:12 [2025-11-23T02:46:12.404Z] + sha256sum jenkins_backup_20251123_024610.sql 02:46:12 [2025-11-23T02:46:12.404Z] + echo โœ… Backup created: jenkins_backup_20251123_024610.sql 02:46:12 [2025-11-23T02:46:12.404Z] โœ… Backup created: jenkins_backup_20251123_024610.sql 02:46:12 [2025-11-23T02:46:12.404Z] + ls -lh jenkins_backup_20251123_024610.sql 02:46:12 [2025-11-23T02:46:12.404Z] -rw-r--r-- 1 root root 6.9K Nov 23 02:46 jenkins_backup_20251123_024610.sql [Pipeline] } [Pipeline] // withCredentials [Pipeline] archiveArtifacts 02:46:12 [2025-11-23T02:46:12.761Z] Archiving artifacts 02:46:12 [2025-11-23T02:46:12.766Z] Recording fingerprints [Pipeline] } [Pipeline] // script [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Declarative: Post Actions) [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:16 [2025-11-23T02:46:16.339Z] ๐Ÿ“‹ Pipeline completed with status: SUCCESS [Pipeline] echo 02:46:16 [2025-11-23T02:46:16.443Z] 02:46:16 [2025-11-23T02:46:16.443Z] ๐ŸŽฏ PostgreSQL Deployment Pipeline 02:46:16 [2025-11-23T02:46:16.443Z] ๐Ÿ“… Build: 29 02:46:16 [2025-11-23T02:46:16.443Z] ๐ŸŒฟ Branch: null 02:46:16 [2025-11-23T02:46:16.443Z] ๐Ÿท๏ธ Commit: ade1f21b 02:46:16 [2025-11-23T02:46:16.443Z] โฑ๏ธ Duration: 1 min 15 sec and counting 02:46:16 [2025-11-23T02:46:16.443Z] โœ… Status: SUCCESS 02:46:16 [2025-11-23T02:46:16.443Z] [Pipeline] sh 02:46:16 [2025-11-23T02:46:16.765Z] + find jenkins_backups -name *.sql -type f 02:46:16 [2025-11-23T02:46:16.765Z] + sort -r 02:46:16 [2025-11-23T02:46:16.765Z] + tail -n +6 02:46:16 [2025-11-23T02:46:16.765Z] + xargs rm -f [Pipeline] } [Pipeline] // script [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:17 [2025-11-23T02:46:17.269Z] ๐ŸŽ‰ PostgreSQL deployment successful! [Pipeline] } [Pipeline] // script [Pipeline] script [Pipeline] { [Pipeline] echo 02:46:19 [2025-11-23T02:46:19.590Z] ๐Ÿงน Cleaning up workspace... [Pipeline] sh 02:46:19 [2025-11-23T02:46:19.917Z] + rm -f *.tmp [Pipeline] echo 02:46:20 [2025-11-23T02:46:20.033Z] โœ… 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