Allow more than 2 pg versions to be installed (#18772)

* Allow more than 2 pg versions to be installed

* Ensure PATH is updated with PGBIN

* Ensure all variables are set
This commit is contained in:
Cyril Rohr
2025-05-06 11:16:50 +02:00
committed by GitHub
parent 2a17eabbaa
commit 60b90bf657
5 changed files with 20 additions and 11 deletions
+2 -2
View File
@@ -16,9 +16,9 @@ ENV APP_USER=app
ENV APP_PATH=/app
ENV APP_DATA_PATH=/var/openproject/assets
ENV PGVERSION="13"
ENV CURRENT_PGVERSION="13"
ENV NEXT_PGVERSION="15"
ENV PGVERSION_CHOICES="13 15 17"
ENV PGBIN="/usr/lib/postgresql/$PGVERSION/bin"
ENV PATH="$PGBIN:$PATH"
ENV BUNDLE_WITHOUT="development:test"
# RAILS
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/bash
set -eox pipefail
set -euxo pipefail
# Ensure we can write in /tmp/op_uploaded_files (cf. #29112)
mkdir -p /tmp/op_uploaded_files/ && chown -R $APP_USER:$APP_USER /tmp/op_uploaded_files/
+11 -5
View File
@@ -1,5 +1,5 @@
#!/bin/bash
set -eox pipefail
set -euxo pipefail
apt-get update -qq
@@ -17,8 +17,6 @@ fi
# embed all-in-one additional software
apt-get install -y \
postgresql-$CURRENT_PGVERSION \
postgresql-$NEXT_PGVERSION \
memcached \
postfix \
apache2 \
@@ -26,12 +24,20 @@ apt-get install -y \
git subversion \
wget
# Install postgres server versions
for version in $PGVERSION_CHOICES ; do
apt-get install -yq --no-install-recommends postgresql-$version
done
# remove any existing cluster
service postgresql stop
rm -rf /var/lib/postgresql/{$CURRENT_PGVERSION,$NEXT_PGVERSION}
for version in $PGVERSION_CHOICES ; do
rm -rf /var/lib/postgresql/{$version}
done
echo "PGBIN: $PGBIN"
# create schema_cache.yml and db/structure.sql
su - postgres -c "$PGBIN/initdb -D /tmp/nulldb -E UTF8"
su - postgres -c "$PGBIN/pg_ctl -D /tmp/nulldb -l /dev/null -l /tmp/nulldb/log -w start"
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/bash
set -exo pipefail
set -euxo pipefail
if [ -f config/frontend_assets.manifest.json ]; then
echo "Assets have already been precompiled. Reusing."
+5 -2
View File
@@ -1,4 +1,5 @@
#!/bin/bash
set -euxo pipefail
get_architecture() {
if command -v uname > /dev/null; then
@@ -40,8 +41,6 @@ echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' > /etc/ap
apt-get update -qq
apt-get install -yq --no-install-recommends \
libpq-dev \
postgresql-client-$CURRENT_PGVERSION \
postgresql-client-$NEXT_PGVERSION \
libpq5 \
libffi8 \
unrtf \
@@ -53,6 +52,10 @@ apt-get install -yq --no-install-recommends \
libjemalloc2 \
git
for version in $PGVERSION_CHOICES ; do
apt-get install -yq --no-install-recommends postgresql-client-$version
done
# Specifics for BIM edition
if [ ! "$BIM_SUPPORT" = "false" ]; then
apt-get install -y wget unzip