No description
  • Groovy 69.9%
  • Shell 11.5%
  • JavaScript 11.5%
  • Less 3.7%
  • CSS 3.3%
  • Other 0.1%
Find a file
2026-02-12 09:35:05 +01:00
buildSrc optimize deployment system 2024-09-17 19:55:51 +02:00
docker comment 2025-03-27 09:15:18 +01:00
gradle/wrapper optimize deployment system 2024-09-17 19:55:51 +02:00
grails-app z-index of sticky header 2026-02-12 09:35:05 +01:00
src switch off cache for JMS updated objects 2024-10-28 17:25:48 +01:00
tools show all Submission of provider, even the ones without sales 2026-02-05 20:25:10 +01:00
.editorconfig use "war" target for gradle, we do no longer use springBoot executor 2023-03-15 11:05:51 +01:00
.gitignore use UserAwareControllerTrait from auth plugin 2023-04-19 13:59:02 +02:00
.sdkmanrc-template optimize deployment system 2024-09-17 19:55:51 +02:00
build.gradle upgrade build script 2024-12-23 12:19:52 +01:00
deploy2DockerLocal.sh upgrade dependencies 2025-03-19 12:33:40 +01:00
deploy2PROD-ALL.sh more time between deployment to the two production nodes 2023-06-19 16:19:41 +02:00
deploy2PROD1.sh cleanup, fix session Id in JS queries 2024-10-10 12:50:30 +02:00
deploy2PROD2.sh cleanup, fix session Id in JS queries 2024-10-10 12:50:30 +02:00
deploy2STAGE.sh fix deployment STAGE 2024-09-20 13:43:29 +02:00
deploy2STAGE1.sh fix deployment STAGE 2024-09-20 13:43:29 +02:00
deploy2STAGE2.sh fix deployment STAGE 2024-09-20 13:43:29 +02:00
deployDocker2PROD.sh make it run on PROD server 2023-05-23 16:05:46 +02:00
deployDocker2Stage.sh added tomcat config to make it work behind a proxy server 2023-04-17 16:02:29 +02:00
gradle.properties version = 2.2.3 2026-02-05 20:25:39 +01:00
gradlew optimize deployment system 2024-09-17 19:55:51 +02:00
grails-cli.yml upgrade to GRAILS 6.1.1 & Gradle 7.6.x 2024-01-11 11:52:42 +01:00
INSTALL.md upgrade invoice path 2024-12-16 11:00:45 +01:00
README.md enable seamless app upgrades without user session interruption 2024-03-25 12:23:55 +01:00
settings.gradle upgrade Java to 17 2024-01-23 09:42:30 +01:00
TODO.md WIP TopSubmission detail page 2023-08-23 12:31:59 +02:00

Update instance (blue/green deployment)

https://www.claudiokuenzler.com/blog/1240/haproxy-how-to-disable-enable-backend-server-command-line-cli-socket

  • Open a shell in the HAProxy docker container
docker exec -it k4proxy /bin/sh
  • Inside the container
# Make sure, socat is installed
apk add socat

# show backend servers
echo "show servers state" | socat unix-connect:/var/run/haproxy.sock stdio

# disable one server
echo "disable server k4webservers/s1" | socat unix-connect:/var/run/haproxy.sock stdio
  • Update instance (outside the container)
./deploy2PROD1.sh
  • If everything is fine (Logs, etc.), then enable the backend server in the docker container again
# enable first server again
echo "enable server k4webservers/s1" | socat unix-connect:/var/run/haproxy.sock stdio

# and disable the other server
echo "disable server k4webservers/s2" | socat unix-connect:/var/run/haproxy.sock stdio
  • Then update the other instance (outside the container)
./deploy2PROD2.sh

Upgrade PostGres (different DB install users, at least one of them "root"; i.e. before v16)

  • Dump old data
docker exec -it pdgbK4P /bin/bash
pg_dump -d k4photographers -U root > dumpK4P.sql
  • stop all containers
  • copy /docker/db directory to /docker/db<oldVersion>
  • empty /docker/db/data directory (keep docker-entrypoint-initdb.d)
  • start (upgraded) postgres container pgdbK4P to initialize the new version database
  • Restore DB dump on new machine (dwhprovider data restore will not work)
docker exec -it pdgbK4P /bin/bash
psql -d k4photographers -U postgres < dumpK4P.sql
  • Start K4P Grails Application to initialize everything code related (or additional missing columns)
  • Run etl.groovy script with MIN_INVOICE=1 and MIN_ASSET=1 to fetch all data initially.

Upgrade PostGres (same DB install users, but not "root"; i.e. from v16 on)

Background: The pg_upgrade command is designed to upgrade f.e. the layout of the system tables; while a simple dump-and-restore writes all data again and might fail with constraint errors, pg_upgrade aims to update system data only and to reuse the old user data as-is. Unfortunately the "root" table is a system table, which is also present for a database install user "root". So, if you chose to install PostGres against the recommendations as "root" it breaks pg_upgrade (and probably pg_restore etc., too).

  • stop all containers
  • copy /docker/db directory to /docker/db<oldVersion> (and additional backup folder)
  • empty /docker/db directory, (re)add empty /docker/db/data folder (no docker-entrypoint-initdb.d!)
  • start (upgraded) postgres container pgdbK4P to initialize the new version database
  • stop the (upgraded) postgres container again
  • build the upgrade container
docker build -t pg_upgrade_15-16:latest -f Upgrade_Dockerfile .
# Upgrade_Dockerfile
FROM postgres:16

ENV PGBINOLD=/usr/lib/postgresql/15/bin/
ENV PGBINNEW=/usr/lib/postgresql/16/bin/
ENV PGDATAOLD=/var/lib/postgresql/olddata
ENV PGDATANEW=/var/lib/postgresql/data

RUN apt-get update && apt-get install -y postgresql-15

USER postgres
WORKDIR /var/lib/postgresql/
CMD [ "/usr/lib/postgresql/16/bin/pg_upgrade" ]
  • start the upgrade container with both db volumes mounted
docker run -ti -v "./db15/data:/var/lib/postgresql/olddata" \
               -v "./db/data:/var/lib/postgresql/data" pg_upgrade_15-16