diff --git a/README.md b/README.md index dac8e59a..2b4a17a4 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ The complete list of available properties can be found in the [spec](jobs/postgr Property | Description -------- | ------------- -databases.version | Define the used PostgreSQL major version. Default: 16 +databases.version | Define the used PostgreSQL major version. Default: 18. Supported versions: 15, 16, 17, 18 databases.port | The database port. Default: 5432 databases.databases | A list of databases and associated properties to create when Postgres starts databases.databases[n].name | Database name diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 7c4eea81..7941de99 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -43,6 +43,8 @@ jobs: trigger: true - get: postgres-17-src trigger: true + - get: postgres-18-src + trigger: true - get: yq-release trigger: true params: @@ -95,6 +97,18 @@ jobs: options: access_key_id: ((postgres-release-blobstore-user.username)) secret_access_key: ((postgres-release-blobstore-user.password)) + - task: bump-postgres-18-package + file: postgres-release/ci/tasks/bump-postgres-packages/task.yml + image: bosh-integration-image + input_mapping: + postgres-src: postgres-18-src + params: + MAJOR_VERSION: 18 + 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 @@ -148,6 +162,7 @@ jobs: - postgresql-15 - postgresql-16 - postgresql-17 + - postgresql-18 - yq on_success: do: @@ -299,6 +314,13 @@ resources: regex: 'href="v(?P17\.[0-9.]+)/"' uri: "https://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.gz" + - name: postgres-18-src + type: http-resource + source: + index: "https://ftp.postgresql.org/pub/source/" + regex: 'href="v(?P18\.[0-9.]+)/"' + uri: "https://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.gz" + - name: yq-release type: github-release source: diff --git a/jobs/bbr-postgres-db/spec b/jobs/bbr-postgres-db/spec index 0699f005..0399c7f3 100644 --- a/jobs/bbr-postgres-db/spec +++ b/jobs/bbr-postgres-db/spec @@ -17,6 +17,7 @@ packages: - postgres-15 - postgres-16 - postgres-17 + - postgres-18 consumes: - name: database @@ -47,7 +48,7 @@ properties: description: "Secret key used for the client certificate. Specify it if you want to authenticate using certificates." postgres.single-transaction: default: false - description: "uses singele transaction when restoring databases" + description: "uses single transaction when restoring databases" postgres.version: - description: "The database version e.g. 15, 16 or 17" - default: 16 + description: "The database version e.g. 15, 16, 17 or 18" + default: 18 diff --git a/jobs/postgres/spec b/jobs/postgres/spec index 8440d47b..638b8545 100644 --- a/jobs/postgres/spec +++ b/jobs/postgres/spec @@ -31,6 +31,7 @@ packages: - postgres-15 - postgres-16 - postgres-17 + - postgres-18 - postgres-yq-4 provides: @@ -44,8 +45,8 @@ provides: properties: databases.version: - description: "The database version e.g. 15, 16 or 17" - default: 16 + description: "The database version e.g. 15, 16, 17 or 18" + default: 18 databases.port: description: "The database port" default: 5432 diff --git a/jobs/postgres/templates/used_postgresql_versions.yml b/jobs/postgres/templates/used_postgresql_versions.yml index 9c9d1865..fdd6360c 100644 --- a/jobs/postgres/templates/used_postgresql_versions.yml +++ b/jobs/postgres/templates/used_postgresql_versions.yml @@ -1,9 +1,11 @@ postgresql: - default: 16 + default: 18 major_version: - 16: - minor_version: "16.14" 15: minor_version: "15.18" + 16: + minor_version: "16.14" 17: minor_version: "17.10" + 18: + minor_version: "18.2" \ No newline at end of file diff --git a/packages/postgres-18/packaging b/packages/postgres-18/packaging new file mode 100755 index 00000000..dc6af30e --- /dev/null +++ b/packages/postgres-18/packaging @@ -0,0 +1,49 @@ +#!/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 + diff --git a/packages/postgres-18/spec b/packages/postgres-18/spec new file mode 100644 index 00000000..f8a10685 --- /dev/null +++ b/packages/postgres-18/spec @@ -0,0 +1,5 @@ +--- +name: postgres-18 +files: + - postgres/postgresql-18.*.tar.gz +