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:22 [2025-11-29T02:45:22.873Z] [WS-CLEANUP] Deleting project workspace...
02:45:22 [2025-11-29T02:45:22.873Z] [WS-CLEANUP] Deferred wipeout is used...
02:45:22 [2025-11-29T02:45:22.914Z] [WS-CLEANUP] done
[Pipeline] checkout
02:45:23 [2025-11-29T02:45:23.472Z] Selected Git installation does not exist. Using Default
02:45:23 [2025-11-29T02:45:23.472Z] The recommended git tool is: NONE
02:45:23 [2025-11-29T02:45:23.472Z] using credential f048d47c-1ea1-4dc6-b81c-f1ec032f0d77
02:45:23 [2025-11-29T02:45:23.503Z] Cloning the remote Git repository
02:45:23 [2025-11-29T02:45:23.503Z] Cloning repository https://github.com/DrPersico/postgresql.git
02:45:23 [2025-11-29T02:45:23.503Z] > git init /var/jenkins_home/workspace/postgres-deploy # timeout=10
02:45:23 [2025-11-29T02:45:23.558Z] Fetching upstream changes from https://github.com/DrPersico/postgresql.git
02:45:23 [2025-11-29T02:45:23.558Z] > git --version # timeout=10
02:45:23 [2025-11-29T02:45:23.576Z] > git --version # 'git version 2.47.3'
02:45:23 [2025-11-29T02:45:23.576Z] using GIT_ASKPASS to set credentials Github
02:45:23 [2025-11-29T02:45:23.611Z] > git fetch --tags --force --progress -- https://github.com/DrPersico/postgresql.git +refs/heads/*:refs/remotes/origin/* # timeout=10
02:45:25 [2025-11-29T02:45:25.237Z] > git config remote.origin.url https://github.com/DrPersico/postgresql.git # timeout=10
02:45:25 [2025-11-29T02:45:25.258Z] > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
02:45:25 [2025-11-29T02:45:25.289Z] Avoid second fetch
02:45:25 [2025-11-29T02:45:25.290Z] > git rev-parse refs/remotes/origin/main^{commit} # timeout=10
02:45:25 [2025-11-29T02:45:25.310Z] Checking out Revision ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da (refs/remotes/origin/main)
02:45:25 [2025-11-29T02:45:25.310Z] > git config core.sparsecheckout # timeout=10
02:45:25 [2025-11-29T02:45:25.329Z] > git checkout -f ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da # timeout=10
02:45:25 [2025-11-29T02:45:25.374Z] Commit message: "Fix backup container restart loop - add command separators"
[Pipeline] echo
02:45:25 [2025-11-29T02:45:25.597Z] โ
Code checked out successfully
[Pipeline] pwd
[Pipeline] echo
02:45:25 [2025-11-29T02:45:25.728Z] ๐ Working directory: /var/jenkins_home/workspace/postgres-deploy
[Pipeline] echo
02:45:25 [2025-11-29T02:45:25.869Z] ๐ฟ Git branch: null
[Pipeline] echo
02:45:25 [2025-11-29T02:45:25.963Z] ๐ท๏ธ Git commit: ade1f21be3ea31e81a6f387d5d2dfb8a955ff3da
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Validate Configuration)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:45:27 [2025-11-29T02:45:27.269Z] ๐ Validating configuration files...
[Pipeline] fileExists
[Pipeline] echo
02:45:29 [2025-11-29T02:45:29.391Z] โ
Found: docker-compose.yml
[Pipeline] fileExists
[Pipeline] echo
02:45:29 [2025-11-29T02:45:29.697Z] โ
Found: postgresql/conf/postgresql.conf
[Pipeline] fileExists
[Pipeline] echo
02:45:29 [2025-11-29T02:45:29.938Z] โ
Found: postgresql/conf/pg_hba.conf
[Pipeline] fileExists
[Pipeline] echo
02:45:30 [2025-11-29T02:45:30.269Z] โ
Found: postgresql/init/01-init-database.sh
[Pipeline] fileExists
[Pipeline] echo
02:45:30 [2025-11-29T02:45:30.733Z] โ
Found: .env.example
[Pipeline] sh
02:45:31 [2025-11-29T02:45:31.056Z] + echo ๐ณ Validating Docker Compose files...
02:45:31 [2025-11-29T02:45:31.056Z] ๐ณ Validating Docker Compose files...
02:45:31 [2025-11-29T02:45:31.056Z] + docker-compose -f docker-compose.yml config --quiet
02:45:31 [2025-11-29T02:45:31.056Z] time="2025-11-29T02:45:30Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string."
02:45:31 [2025-11-29T02:45:31.056Z] time="2025-11-29T02:45:30Z" level=warning msg="The \"POSTGRES_PASSWORD\" variable is not set. Defaulting to a blank string."
[Pipeline] sh
02:45:31 [2025-11-29T02:45:31.423Z] + echo ๐๏ธ Validating PostgreSQL configuration...
02:45:31 [2025-11-29T02:45:31.423Z] ๐๏ธ Validating PostgreSQL configuration...
02:45:31 [2025-11-29T02:45:31.423Z] + grep -E ^(shared_buffers|effective_cache_size|work_mem) postgresql/conf/postgresql.conf
02:45:31 [2025-11-29T02:45:31.423Z] shared_buffers = 512MB # 25% of RAM
02:45:31 [2025-11-29T02:45:31.423Z] effective_cache_size = 2GB # 50% of RAM
02:45:31 [2025-11-29T02:45:31.423Z] work_mem = 8MB # Per connection
[Pipeline] sh
02:45:31 [2025-11-29T02:45:31.837Z] + echo ๐ Checking Jenkins credentials configuration...
02:45:31 [2025-11-29T02:45:31.837Z] ๐ Checking Jenkins credentials configuration...
02:45:31 [2025-11-29T02:45:31.837Z] + echo โน๏ธ Note: Make sure you have configured these Jenkins credentials:
02:45:31 [2025-11-29T02:45:31.837Z] โน๏ธ Note: Make sure you have configured these Jenkins credentials:
02:45:31 [2025-11-29T02:45:31.837Z] + echo - postgres-password (Secret Text): Your PostgreSQL password
02:45:31 [2025-11-29T02:45:31.837Z] - postgres-password (Secret Text): Your PostgreSQL password
02:45:31 [2025-11-29T02:45:31.837Z] + echo - postgres-db (String, optional): Database name (default: postgres)
02:45:31 [2025-11-29T02:45:31.837Z] - postgres-db (String, optional): Database name (default: postgres)
02:45:31 [2025-11-29T02:45:31.837Z] + echo - postgres-user (String, optional): Database user (default: postgres)
02:45:31 [2025-11-29T02:45:31.837Z] - postgres-user (String, optional): Database user (default: postgres)
02:45:31 [2025-11-29T02:45:31.837Z] + echo ๐ Configure in: Jenkins โ Manage Jenkins โ Manage Credentials โ (global)
02:45:31 [2025-11-29T02:45:31.837Z] ๐ 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:32 [2025-11-29T02:45:32.891Z] ๐ Checking system resources...
[Pipeline] sh
02:45:33 [2025-11-29T02:45:33.245Z] + docker info
02:45:33 [2025-11-29T02:45:33.245Z] + echo โ
Docker is running
02:45:33 [2025-11-29T02:45:33.245Z] โ
Docker is running
02:45:33 [2025-11-29T02:45:33.245Z] + echo ๐พ Memory information:
02:45:33 [2025-11-29T02:45:33.245Z] ๐พ Memory information:
02:45:33 [2025-11-29T02:45:33.245Z] + free -h
02:45:33 [2025-11-29T02:45:33.245Z] total used free shared buff/cache available
02:45:33 [2025-11-29T02:45:33.245Z] Mem: 7.6Gi 4.0Gi 440Mi 650Mi 4.1Gi 3.6Gi
02:45:33 [2025-11-29T02:45:33.245Z] Swap: 0B 0B 0B
02:45:33 [2025-11-29T02:45:33.245Z] + echo ๐ฟ Disk space:
02:45:33 [2025-11-29T02:45:33.245Z] ๐ฟ Disk space:
02:45:33 [2025-11-29T02:45:33.245Z] + df -h .
02:45:33 [2025-11-29T02:45:33.245Z] Filesystem Size Used Avail Use% Mounted on
02:45:33 [2025-11-29T02:45:33.245Z] /dev/mmcblk0p2 29G 27G 1.4G 96% /var/jenkins_home
02:45:33 [2025-11-29T02:45:33.245Z] + echo ๐ฅ๏ธ CPU information:
02:45:33 [2025-11-29T02:45:33.245Z] ๐ฅ๏ธ CPU information:
02:45:33 [2025-11-29T02:45:33.245Z] + nproc
02:45:33 [2025-11-29T02:45:33.245Z] 4
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy PostgreSQL)
[Pipeline] echo
02:45:37 [2025-11-29T02:45:37.188Z] Warning, empty changelog. Have you run checkout?
[Pipeline] echo
02:45:37 [2025-11-29T02:45:37.332Z] Warning, empty changelog. Have you run checkout?
[Pipeline] echo
02:45:37 [2025-11-29T02:45:37.529Z] Warning, empty changelog. Have you run checkout?
[Pipeline] echo
02:45:37 [2025-11-29T02:45:37.718Z] Warning, empty changelog. Have you run checkout?
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:45:38 [2025-11-29T02:45:38.145Z] ๐ Deploying PostgreSQL...
[Pipeline] sh
02:45:38 [2025-11-29T02:45:38.457Z] + chmod +x postgresql/scripts/backup.sh postgresql/scripts/backup_check.sh postgresql/scripts/deploy.sh
[Pipeline] withCredentials
02:45:38 [2025-11-29T02:45:38.648Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER
[Pipeline] {
[Pipeline] sh
02:45:39 [2025-11-29T02:45:39.064Z] + echo ๐ง Using Jenkins credentials for deployment...
02:45:39 [2025-11-29T02:45:39.064Z] ๐ง Using Jenkins credentials for deployment...
02:45:39 [2025-11-29T02:45:39.064Z] + export POSTGRES_DB=****
02:45:39 [2025-11-29T02:45:39.064Z] + export POSTGRES_USER=****
02:45:39 [2025-11-29T02:45:39.065Z] + export POSTGRES_PASSWORD=****
02:45:39 [2025-11-29T02:45:39.065Z] + export PROJECT_NAME=Generic PostgreSQL
02:45:39 [2025-11-29T02:45:39.065Z] + export PROJECT_SCHEMA=none
02:45:39 [2025-11-29T02:45:39.065Z] + export JENKINS_WORKSPACE=/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql
02:45:39 [2025-11-29T02:45:39.065Z] + echo ๐ Deployment configuration:
02:45:39 [2025-11-29T02:45:39.065Z] ๐ Deployment configuration:
02:45:39 [2025-11-29T02:45:39.065Z] + echo Database: ****
02:45:39 [2025-11-29T02:45:39.065Z] Database: ****
02:45:39 [2025-11-29T02:45:39.065Z] + echo User: ****
02:45:39 [2025-11-29T02:45:39.065Z] User: ****
02:45:39 [2025-11-29T02:45:39.065Z] + echo Project: Generic PostgreSQL
02:45:39 [2025-11-29T02:45:39.066Z] Project: Generic PostgreSQL
02:45:39 [2025-11-29T02:45:39.066Z] + echo Schema: none
02:45:39 [2025-11-29T02:45:39.066Z] Schema: none
02:45:39 [2025-11-29T02:45:39.066Z] + echo Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql
02:45:39 [2025-11-29T02:45:39.066Z] Workspace: /home/geeplo/services/jenkins_home/workspace/****-deploy/****ql
02:45:39 [2025-11-29T02:45:39.066Z] + echo Password: [REDACTED]
02:45:39 [2025-11-29T02:45:39.066Z] Password: [REDACTED]
02:45:39 [2025-11-29T02:45:39.066Z] + docker-compose -f docker-compose.yml down
02:45:39 [2025-11-29T02:45:39.317Z] Container datashield-backup Stopping
02:45:51 [2025-11-29T02:45:51.419Z] Container datashield-backup Stopped
02:45:51 [2025-11-29T02:45:51.419Z] Container datashield-backup Removing
02:45:51 [2025-11-29T02:45:51.419Z] Container datashield-backup Removed
02:45:51 [2025-11-29T02:45:51.419Z] Container ****-**** Stopping
02:45:55 [2025-11-29T02:45:55.546Z] Container ****-**** Stopped
02:45:55 [2025-11-29T02:45:55.546Z] Container ****-**** Removing
02:45:55 [2025-11-29T02:45:55.546Z] Container ****-**** Removed
02:45:55 [2025-11-29T02:45:55.546Z] Network ****-deploy_datashield-network Removing
02:45:55 [2025-11-29T02:45:55.547Z] Network ****-deploy_datashield-network Resource is still in use
02:45:55 [2025-11-29T02:45:55.547Z] + sed s/\${POSTGRES_DB}/****/g docker-compose.yml
02:45:55 [2025-11-29T02:45:55.547Z] + sed -i s/\${POSTGRES_USER}/****/g docker-compose.tmp.yml
02:45:55 [2025-11-29T02:45:55.547Z] + sed -i s/\${POSTGRES_PASSWORD}/****/g docker-compose.tmp.yml
02:45:55 [2025-11-29T02:45:55.547Z] + sed -i s/\${PROJECT_NAME}/Generic PostgreSQL/g docker-compose.tmp.yml
02:45:55 [2025-11-29T02:45:55.547Z] + sed -i s/\${PROJECT_SCHEMA}/none/g docker-compose.tmp.yml
02:45:55 [2025-11-29T02:45:55.547Z] + sed -i s|\${JENKINS_WORKSPACE:-./****ql}|/home/geeplo/services/jenkins_home/workspace/****-deploy/****ql|g docker-compose.tmp.yml
02:45:55 [2025-11-29T02:45:55.548Z] + docker-compose -f docker-compose.tmp.yml up -d ****
02:45:55 [2025-11-29T02:45:55.799Z] Container ****-**** Creating
02:45:56 [2025-11-29T02:45:56.712Z] **** Your kernel does not support memory limit capabilities or the cgroup is not mounted. Limitation discarded.
02:45:56 [2025-11-29T02:45:56.712Z] **** Your kernel does not support memory soft limit capabilities or the cgroup is not mounted. Limitation discarded.
02:45:56 [2025-11-29T02:45:56.712Z] Container ****-**** Created
02:45:56 [2025-11-29T02:45:56.712Z] Container ****-**** Starting
02:45:57 [2025-11-29T02:45:57.625Z] Container ****-**** Started
02:45:57 [2025-11-29T02:45:57.625Z] + echo โณ Waiting for PostgreSQL to be ready...
02:45:57 [2025-11-29T02:45:57.625Z] โณ Waiting for PostgreSQL to be ready...
02:45:57 [2025-11-29T02:45:57.625Z] + docker exec ****-**** pg_isready -U **** -d ****
02:45:58 [2025-11-29T02:45:58.178Z] + echo โณ Waiting for PostgreSQL (attempt {1..60}/60)...
02:45:58 [2025-11-29T02:45:58.178Z] โณ Waiting for PostgreSQL (attempt {1..60}/60)...
02:45:58 [2025-11-29T02:45:58.178Z] + sleep 2
02:46:00 [2025-11-29T02:46:00.042Z] + docker exec ****-**** pg_isready -U **** -d ****
02:46:00 [2025-11-29T02:46:00.294Z] /var/run/****ql:5432 - accepting connections
02:46:00 [2025-11-29T02:46:00.294Z] + docker-compose -f docker-compose.tmp.yml up -d ****-backup
02:46:00 [2025-11-29T02:46:00.545Z] Container ****-**** Running
02:46:00 [2025-11-29T02:46:00.545Z] Container datashield-backup Creating
02:46:08 [2025-11-29T02:46:08.572Z] Container datashield-backup Created
02:46:08 [2025-11-29T02:46:08.572Z] Container ****-**** Waiting
02:46:08 [2025-11-29T02:46:08.823Z] Container ****-**** Healthy
02:46:08 [2025-11-29T02:46:08.823Z] Container datashield-backup Starting
02:46:09 [2025-11-29T02:46:09.736Z] Container datashield-backup Started
02:46:09 [2025-11-29T02:46:09.736Z] + rm docker-compose.tmp.yml
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] echo
02:46:11 [2025-11-29T02:46:11.321Z] โ
PostgreSQL deployed successfully
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Verify Deployment)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:17 [2025-11-29T02:46:17.422Z] ๐ Verifying deployment...
[Pipeline] withCredentials
02:46:17 [2025-11-29T02:46:17.510Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER
[Pipeline] {
[Pipeline] sh
02:46:17 [2025-11-29T02:46:17.903Z] + export POSTGRES_DB=****
02:46:17 [2025-11-29T02:46:17.903Z] + export POSTGRES_USER=****
02:46:17 [2025-11-29T02:46:17.903Z] + export PGPASSWORD=****
02:46:17 [2025-11-29T02:46:17.903Z] + echo ๐ณ Container status:
02:46:17 [2025-11-29T02:46:17.903Z] ๐ณ Container status:
02:46:17 [2025-11-29T02:46:17.903Z] + docker ps
02:46:17 [2025-11-29T02:46:17.904Z] + grep ****
02:46:17 [2025-11-29T02:46:17.904Z] 3a8be82b778a ****:18-alpine "docker-entrypoint.sโฆ" 17 seconds ago Up 8 seconds 5432/tcp datashield-backup
02:46:17 [2025-11-29T02:46:17.905Z] d803faf3f35b ****:18-alpine "docker-entrypoint.sโฆ" 22 seconds ago Up 21 seconds (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp ****-****
02:46:17 [2025-11-29T02:46:17.905Z] + echo ๐ Testing database connection...
02:46:17 [2025-11-29T02:46:17.905Z] ๐ Testing database connection...
02:46:17 [2025-11-29T02:46:17.905Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c SELECT 1 as connection_test;
02:46:18 [2025-11-29T02:46:18.156Z] connection_test
02:46:18 [2025-11-29T02:46:18.156Z] -----------------
02:46:18 [2025-11-29T02:46:18.156Z] 1
02:46:18 [2025-11-29T02:46:18.156Z] (1 row)
02:46:18 [2025-11-29T02:46:18.156Z]
02:46:18 [2025-11-29T02:46:18.156Z] + echo ๐ Database statistics:
02:46:18 [2025-11-29T02:46:18.156Z] ๐ Database statistics:
02:46:18 [2025-11-29T02:46:18.156Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c
02:46:18 [2025-11-29T02:46:18.156Z] SELECT
02:46:18 [2025-11-29T02:46:18.156Z] 'total schemas' as check,
02:46:18 [2025-11-29T02:46:18.156Z] COUNT(*)::text as result
02:46:18 [2025-11-29T02:46:18.156Z] FROM information_schema.schemata
02:46:18 [2025-11-29T02:46:18.157Z] WHERE schema_name NOT IN ('information_schema', 'pg_catalog');
02:46:18 [2025-11-29T02:46:18.157Z]
02:46:18 [2025-11-29T02:46:18.408Z] check | result
02:46:18 [2025-11-29T02:46:18.408Z] ---------------+--------
02:46:18 [2025-11-29T02:46:18.408Z] total schemas | 2
02:46:18 [2025-11-29T02:46:18.408Z] (1 row)
02:46:18 [2025-11-29T02:46:18.408Z]
02:46:18 [2025-11-29T02:46:18.408Z] + echo ๐พ Testing backup system...
02:46:18 [2025-11-29T02:46:18.408Z] ๐พ Testing backup system...
02:46:18 [2025-11-29T02:46:18.408Z] + docker exec ****-backup /scripts/backup_check.sh
02:46:18 [2025-11-29T02:46:18.659Z] Error response from daemon: No such container: ****-backup
02:46:18 [2025-11-29T02:46:18.659Z] + echo โ ๏ธ Backup check not available (container might be starting)
02:46:18 [2025-11-29T02:46:18.659Z] โ ๏ธ Backup check not available (container might be starting)
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] echo
02:46:18 [2025-11-29T02:46:18.996Z] โ
Deployment verification completed
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Performance Test)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:19 [2025-11-29T02:46:19.734Z] โก Running performance tests...
[Pipeline] withCredentials
02:46:19 [2025-11-29T02:46:19.823Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER
[Pipeline] {
[Pipeline] sh
02:46:20 [2025-11-29T02:46:20.224Z] + export POSTGRES_DB=****
02:46:20 [2025-11-29T02:46:20.224Z] + export POSTGRES_USER=****
02:46:20 [2025-11-29T02:46:20.224Z] + export PGPASSWORD=****
02:46:20 [2025-11-29T02:46:20.224Z] + echo ๐ Running basic performance queries...
02:46:20 [2025-11-29T02:46:20.224Z] ๐ Running basic performance queries...
02:46:20 [2025-11-29T02:46:20.225Z] + docker exec -e PGPASSWORD=**** ****-**** psql -h localhost -U **** -d **** -c
02:46:20 [2025-11-29T02:46:20.225Z] -- Test basic query performance
02:46:20 [2025-11-29T02:46:20.225Z] EXPLAIN ANALYZE SELECT 1 as test_query;
02:46:20 [2025-11-29T02:46:20.225Z]
02:46:20 [2025-11-29T02:46:20.225Z] -- Test system catalog performance
02:46:20 [2025-11-29T02:46:20.225Z] EXPLAIN ANALYZE SELECT COUNT(*) FROM information_schema.tables;
02:46:20 [2025-11-29T02:46:20.225Z]
02:46:20 [2025-11-29T02:46:20.225Z] -- Test connection info
02:46:20 [2025-11-29T02:46:20.225Z] SELECT database_name, process_count FROM (
02:46:20 [2025-11-29T02:46:20.225Z] SELECT datname as database_name, COUNT(*) as process_count
02:46:20 [2025-11-29T02:46:20.226Z] FROM pg_stat_activity
02:46:20 [2025-11-29T02:46:20.226Z] GROUP BY datname
02:46:20 [2025-11-29T02:46:20.226Z] ) as activity_stats;
02:46:20 [2025-11-29T02:46:20.226Z]
02:46:20 [2025-11-29T02:46:20.477Z] QUERY PLAN
02:46:20 [2025-11-29T02:46:20.477Z] ---------------------------------------------------------------------------------------
02:46:20 [2025-11-29T02:46:20.477Z] Result (cost=0.00..0.01 rows=1 width=4) (actual time=0.006..0.012 rows=1.00 loops=1)
02:46:20 [2025-11-29T02:46:20.477Z] Planning:
02:46:20 [2025-11-29T02:46:20.477Z] Buffers: shared hit=3
02:46:20 [2025-11-29T02:46:20.477Z] Planning Time: 0.235 ms
02:46:20 [2025-11-29T02:46:20.477Z] Execution Time: 0.162 ms
02:46:20 [2025-11-29T02:46:20.477Z] (5 rows)
02:46:20 [2025-11-29T02:46:20.477Z]
02:46:20 [2025-11-29T02:46:20.478Z] QUERY PLAN
02:46:20 [2025-11-29T02:46:20.478Z] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
02:46:20 [2025-11-29T02:46:20.478Z] Aggregate (cost=71.97..71.98 rows=1 width=8) (actual time=13.089..13.147 rows=1.00 loops=1)
02:46:20 [2025-11-29T02:46:20.478Z] Buffers: shared hit=28 read=12
02:46:20 [2025-11-29T02:46:20.478Z] -> Hash Left Join (cost=36.66..71.69 rows=112 width=0) (actual time=9.005..12.574 rows=215.00 loops=1)
02:46:20 [2025-11-29T02:46:20.478Z] Hash Cond: (c.reloftype = t.oid)
02:46:20 [2025-11-29T02:46:20.479Z] Buffers: shared hit=28 read=12
02:46:20 [2025-11-29T02:46:20.479Z] -> Hash Join (cost=1.09..34.58 rows=112 width=4) (actual time=0.793..3.240 rows=215.00 loops=1)
02:46:20 [2025-11-29T02:46:20.479Z] Hash Cond: (c.relnamespace = nc.oid)
02:46:20 [2025-11-29T02:46:20.479Z] Buffers: shared hit=22 read=1
02:46:20 [2025-11-29T02:46:20.479Z] -> Seq Scan on pg_class c (cost=0.00..32.67 rows=150 width=8) (actual time=0.114..1.383 rows=215.00 loops=1)
02:46:20 [2025-11-29T02:46:20.479Z] 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:20 [2025-11-29T02:46:20.479Z] Rows Removed by Filter: 202
02:46:20 [2025-11-29T02:46:20.480Z] Buffers: shared hit=13 read=1
02:46:20 [2025-11-29T02:46:20.480Z] -> Hash (cost=1.05..1.05 rows=3 width=4) (actual time=0.571..0.580 rows=4.00 loops=1)
02:46:20 [2025-11-29T02:46:20.480Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB
02:46:20 [2025-11-29T02:46:20.480Z] Buffers: shared hit=9
02:46:20 [2025-11-29T02:46:20.480Z] -> Seq Scan on pg_namespace nc (cost=0.00..1.05 rows=3 width=4) (actual time=0.195..0.505 rows=4.00 loops=1)
02:46:20 [2025-11-29T02:46:20.480Z] Filter: (NOT pg_is_other_temp_schema(oid))
02:46:20 [2025-11-29T02:46:20.480Z] Buffers: shared hit=9
02:46:20 [2025-11-29T02:46:20.480Z] -> Hash (cost=27.29..27.29 rows=662 width=4) (actual time=8.117..8.140 rows=639.00 loops=1)
02:46:20 [2025-11-29T02:46:20.480Z] Buckets: 1024 Batches: 1 Memory Usage: 31kB
02:46:20 [2025-11-29T02:46:20.481Z] Buffers: shared hit=6 read=11
02:46:20 [2025-11-29T02:46:20.481Z] -> Hash Join (cost=1.09..27.29 rows=662 width=4) (actual time=0.284..6.019 rows=639.00 loops=1)
02:46:20 [2025-11-29T02:46:20.481Z] Hash Cond: (t.typnamespace = nt.oid)
02:46:20 [2025-11-29T02:46:20.481Z] Buffers: shared hit=6 read=11
02:46:20 [2025-11-29T02:46:20.481Z] -> Seq Scan on pg_type t (cost=0.00..22.62 rows=662 width=8) (actual time=0.069..2.159 rows=639.00 loops=1)
02:46:20 [2025-11-29T02:46:20.481Z] Buffers: shared hit=5 read=11
02:46:20 [2025-11-29T02:46:20.481Z] -> Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.155..0.163 rows=4.00 loops=1)
02:46:20 [2025-11-29T02:46:20.481Z] Buckets: 1024 Batches: 1 Memory Usage: 9kB
02:46:20 [2025-11-29T02:46:20.481Z] Buffers: shared hit=1
02:46:20 [2025-11-29T02:46:20.482Z] -> 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:20 [2025-11-29T02:46:20.482Z] Buffers: shared hit=1
02:46:20 [2025-11-29T02:46:20.482Z] Planning:
02:46:20 [2025-11-29T02:46:20.482Z] Buffers: shared hit=332 read=14
02:46:20 [2025-11-29T02:46:20.482Z] Planning Time: 15.763 ms
02:46:20 [2025-11-29T02:46:20.482Z] Execution Time: 15.111 ms
02:46:20 [2025-11-29T02:46:20.482Z] (35 rows)
02:46:20 [2025-11-29T02:46:20.482Z]
02:46:20 [2025-11-29T02:46:20.482Z] database_name | process_count
02:46:20 [2025-11-29T02:46:20.482Z] ---------------+---------------
02:46:20 [2025-11-29T02:46:20.482Z] | 8
02:46:20 [2025-11-29T02:46:20.482Z] **** | 1
02:46:20 [2025-11-29T02:46:20.482Z] authentik | 7
02:46:20 [2025-11-29T02:46:20.482Z] (3 rows)
02:46:20 [2025-11-29T02:46:20.482Z]
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] echo
02:46:20 [2025-11-29T02:46:20.838Z] โ
Performance tests completed
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Create Backup)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:28 [2025-11-29T02:46:28.565Z] ๐พ Creating deployment backup: jenkins_backup_20251129_024627.sql
[Pipeline] withCredentials
02:46:28 [2025-11-29T02:46:28.726Z] Masking supported pattern matches of $POSTGRES_PASSWORD or $POSTGRES_DB or $POSTGRES_USER
[Pipeline] {
[Pipeline] sh
02:46:28 [2025-11-29T02:46:28.881Z] Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
02:46:28 [2025-11-29T02:46:28.881Z] Affected argument(s) used the following variable(s): [POSTGRES_DB]
02:46:28 [2025-11-29T02:46:28.881Z] See https://jenkins.io/redirect/groovy-string-interpolation for details.
02:46:29 [2025-11-29T02:46:29.148Z] + export POSTGRES_DB=****
02:46:29 [2025-11-29T02:46:29.148Z] + export POSTGRES_USER=****
02:46:29 [2025-11-29T02:46:29.148Z] + export PGPASSWORD=****
02:46:29 [2025-11-29T02:46:29.148Z] + mkdir -p jenkins_backups
02:46:29 [2025-11-29T02:46:29.149Z] + docker exec -e PGPASSWORD=**** ****-**** pg_dump -h localhost -U **** -d **** --format=custom --compress=9 --file=/tmp/jenkins_backup_20251129_024627.sql
02:46:31 [2025-11-29T02:46:31.013Z] + docker cp ****-****:/tmp/jenkins_backup_20251129_024627.sql jenkins_backups/
02:46:31 [2025-11-29T02:46:31.013Z] + cd jenkins_backups
02:46:31 [2025-11-29T02:46:31.013Z] + sha256sum jenkins_backup_20251129_024627.sql
02:46:31 [2025-11-29T02:46:31.013Z] + echo โ
Backup created: jenkins_backup_20251129_024627.sql
02:46:31 [2025-11-29T02:46:31.014Z] โ
Backup created: jenkins_backup_20251129_024627.sql
02:46:31 [2025-11-29T02:46:31.014Z] + ls -lh jenkins_backup_20251129_024627.sql
02:46:31 [2025-11-29T02:46:31.014Z] -rw-r--r-- 1 root root 6.9K Nov 29 02:46 jenkins_backup_20251129_024627.sql
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] archiveArtifacts
02:46:31 [2025-11-29T02:46:31.379Z] Archiving artifacts
02:46:31 [2025-11-29T02:46:31.391Z] Recording fingerprints
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:32 [2025-11-29T02:46:32.336Z] ๐ Pipeline completed with status: SUCCESS
[Pipeline] echo
02:46:32 [2025-11-29T02:46:32.414Z]
02:46:32 [2025-11-29T02:46:32.415Z] ๐ฏ PostgreSQL Deployment Pipeline
02:46:32 [2025-11-29T02:46:32.415Z] ๐
Build: 35
02:46:32 [2025-11-29T02:46:32.415Z] ๐ฟ Branch: null
02:46:32 [2025-11-29T02:46:32.415Z] ๐ท๏ธ Commit: ade1f21b
02:46:32 [2025-11-29T02:46:32.415Z] โฑ๏ธ Duration: 1 min 31 sec and counting
02:46:32 [2025-11-29T02:46:32.415Z] โ
Status: SUCCESS
02:46:32 [2025-11-29T02:46:32.415Z]
[Pipeline] sh
02:46:32 [2025-11-29T02:46:32.720Z] + find jenkins_backups -name *.sql -type f
02:46:32 [2025-11-29T02:46:32.720Z] + sort -r
02:46:32 [2025-11-29T02:46:32.720Z] + + tail -n +6
02:46:32 [2025-11-29T02:46:32.720Z] xargs rm -f
[Pipeline] }
[Pipeline] // script
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:33 [2025-11-29T02:46:33.355Z] ๐ PostgreSQL deployment successful!
[Pipeline] }
[Pipeline] // script
[Pipeline] script
[Pipeline] {
[Pipeline] echo
02:46:34 [2025-11-29T02:46:34.175Z] ๐งน Cleaning up workspace...
[Pipeline] sh
02:46:34 [2025-11-29T02:46:34.472Z] + rm -f *.tmp
[Pipeline] echo
02:46:34 [2025-11-29T02:46:34.562Z] โ
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