Skip to content

Commit

Permalink
Merge pull request #76 from ZPascal/add-postgresql-16
Browse files Browse the repository at this point in the history
feat: Add PostgreSQL 16 as new major and used release version
  • Loading branch information
jpalermo authored May 7, 2024
2 parents e336919 + 2fdbe5c commit 762a2e0
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 4 deletions.
25 changes: 23 additions & 2 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
trigger: true
- get: postgres-15-src
trigger: true
- get: postgres-16-src
trigger: true
- task: bump-postgres-11-package
file: postgres-release/ci/tasks/bump-postgres-packages/task.yml
image: bosh-cli-registry-image
Expand Down Expand Up @@ -72,6 +74,18 @@ jobs:
options:
access_key_id: ((postgres-release-blobstore-user.username))
secret_access_key: ((postgres-release-blobstore-user.password))
- task: bump-postgres-16-package
file: postgres-release/ci/tasks/bump-postgres-packages/task.yml
image: bosh-cli-registry-image
input_mapping:
postgres-src: postgres-16-src
params:
MAJOR_VERSION: 16
PRIVATE_YML: |
blobstore:
options:
access_key_id: ((postgres-release-blobstore-user.username))
secret_access_key: ((postgres-release-blobstore-user.password))
- put: postgres-release
params:
repository: postgres-release
Expand Down Expand Up @@ -109,7 +123,7 @@ jobs:
file: postgres-release/ci/tasks/check-for-updated-blob/task.yml
image: bosh-cli-registry-image
params:
BLOB: postgresql-15
BLOB: postgresql-16
on_success:
put: final-release-trigger

Expand All @@ -130,7 +144,7 @@ jobs:
file: postgres-release/ci/tasks/check-for-updated-blob/task.yml
image: bosh-cli-registry-image
params:
BLOB: postgresql-15
BLOB: postgresql-16
- task: create-final-release
file: postgres-release/ci/tasks/create-final-release/task.yml
image: bosh-cli-registry-image
Expand Down Expand Up @@ -211,6 +225,13 @@ resources:
regex: 'href="v(?P<version>15\.[0-9.]+)/"'
uri: "https://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.gz"

- name: postgres-16-src
type: http-resource
source:
index: "https://ftp.postgresql.org/pub/source/"
regex: 'href="v(?P<version>16\.[0-9.]+)/"'
uri: "https://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.gz"

- name: postgres-release
type: git
source:
Expand Down
1 change: 1 addition & 0 deletions jobs/bbr-postgres-db/spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ packages:
- postgres-11
- postgres-13
- postgres-15
- postgres-16

consumes:
- name: database
Expand Down
2 changes: 1 addition & 1 deletion jobs/bbr-postgres-db/templates/config.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if_link("database") do |data|
end

%>
current_version="15.6"
current_version="16.2"
JOB_DIR="/var/vcap/jobs/bbr-postgres-db"
PACKAGE_DIR="/var/vcap/packages/postgres-${current_version%.*}"
PORT="<%= port %>"
Expand Down
1 change: 1 addition & 0 deletions jobs/postgres/spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ packages:
- postgres-11
- postgres-13
- postgres-15
- postgres-16

provides:
- name: postgres
Expand Down
2 changes: 1 addition & 1 deletion jobs/postgres/templates/pgconfig.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x # if you want tracing disabled, set 'databases.enable_traces: false' in t
ENABLE_TRACE=0
# set -x # uncomment it if you want to enable tracing in all control scripts
<% end %>
current_version="15.6"
current_version="16.2"
pgversion_current="postgres-${current_version}"

JOB_DIR=/var/vcap/jobs/postgres
Expand Down
48 changes: 48 additions & 0 deletions packages/postgres-16/packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash -exu

function main() {
extract_archive
compile

}

function extract_archive() {

echo "Extracting archive..."
tar xzf postgres/postgresql-*

}

function compile() {

pushd postgresql-* > /dev/null
if [[ "$(uname -a)" =~ "x86_64" || "$(uname -a)" =~ "ppc64le" ]] ; then
ICU_CFLAGS=" " ICU_LIBS="-L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata" ./configure --prefix="${BOSH_INSTALL_TARGET}" --with-openssl
else
ICU_CFLAGS=" " ICU_LIBS="-L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata" CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 ./configure --prefix="${BOSH_INSTALL_TARGET}" --with-openssl
fi

pushd src/bin/pg_config > /dev/null
make -j$(nproc)
make install
popd > /dev/null

cp -LR src/include "${BOSH_INSTALL_TARGET}"
pushd src/interfaces/libpq > /dev/null
make -j$(nproc)
make install
popd > /dev/null

pushd src > /dev/null
make -j$(nproc)
make install
popd > /dev/null

pushd contrib > /dev/null
make -j$(nproc)
make install
popd > /dev/null
popd > /dev/null
}

main
4 changes: 4 additions & 0 deletions packages/postgres-16/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: postgres-16
files:
- postgres/postgresql-16.*.tar.gz

0 comments on commit 762a2e0

Please sign in to comment.