Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
if [[ "${{ inputs.postgresVersion }}" != "" ]]; then
VERSION="${{ inputs.postgresVersion }}"
else
VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT"
Expand Down
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.6.0.036-orioledb"
postgres17: "17.6.1.079"
postgres15: "15.14.1.079"
postgresorioledb-17: "17.6.0.036-orioledb-slim-1"
postgres17: "17.6.1.079-slim-1"
postgres15: "15.14.1.079-slim-1"

# Non Postgres Extensions
pgbouncer_release: 1.25.1
Expand Down
24 changes: 17 additions & 7 deletions nix/ext/hypopg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
buildEnv,
fetchFromGitHub,
postgresql,
latestOnly ? false,
}:

let
Expand All @@ -14,7 +15,13 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
build =
version: hash:
stdenv.mkDerivation rec {
Expand Down Expand Up @@ -66,9 +73,7 @@ let
inherit (postgresql.meta) platforms;
};
};
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash) supportedVersions
);
packages = builtins.attrValues (lib.mapAttrs (name: value: build name value.hash) versionsToUse);
in
buildEnv {
name = pname;
Expand All @@ -81,14 +86,19 @@ buildEnv {
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)
'';

passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
22 changes: 16 additions & 6 deletions nix/ext/index_advisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
fetchFromGitHub,
postgresql,
callPackage,
latestOnly ? false,
}:

let
Expand All @@ -15,7 +16,13 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
build =
version: hash:
stdenv.mkDerivation rec {
Expand Down Expand Up @@ -64,9 +71,7 @@ let
inherit (postgresql.meta) platforms;
};
};
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash) supportedVersions
);
packages = builtins.attrValues (lib.mapAttrs (name: value: build name value.hash) versionsToUse);
in
pkgs.buildEnv {
name = pname;
Expand All @@ -78,8 +83,13 @@ pkgs.buildEnv {
];

passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
24 changes: 17 additions & 7 deletions nix/ext/pg-safeupdate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
fetchFromGitHub,
postgresql,
makeWrapper,
latestOnly ? false,
}:

let
Expand Down Expand Up @@ -49,10 +50,14 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash) supportedVersions
);
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
packages = builtins.attrValues (lib.mapAttrs (name: value: build name value.hash) versionsToUse);
in
pkgs.buildEnv {
name = pname;
Expand All @@ -68,18 +73,23 @@ pkgs.buildEnv {
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)
'';

passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
defaultSettings = {
shared_preload_libraries = [ "safeupdate" ];
};
pgRegressTestName = "pg-safeupdate";
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
22 changes: 17 additions & 5 deletions nix/ext/pg_cron/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
buildEnv,
makeWrapper,
switch-ext-version,
latestOnly ? false,
}:
let
pname = "pg_cron";
Expand All @@ -15,7 +16,13 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
build =
version: versionData:
stdenv.mkDerivation rec {
Expand Down Expand Up @@ -71,7 +78,7 @@ let
license = licenses.postgresql;
};
};
packages = builtins.attrValues (lib.mapAttrs (name: value: build name value) supportedVersions);
packages = builtins.attrValues (lib.mapAttrs (name: value: build name value) versionsToUse);
in
buildEnv {
name = pname;
Expand All @@ -93,7 +100,7 @@ buildEnv {
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)

Expand All @@ -109,13 +116,18 @@ buildEnv {
};

passthru = {
inherit versions numberOfVersions switch-ext-version;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit switch-ext-version latestOnly;
hasBackgroundWorker = true;
defaultSettings = {
shared_preload_libraries = [ "pg_cron" ];
"cron.database_name" = "postgres";
};
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
22 changes: 17 additions & 5 deletions nix/ext/pg_graphql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
postgresql,
rust-bin,
rsync,
latestOnly ? false,
}:

let
Expand Down Expand Up @@ -124,9 +125,15 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) supportedVersions
lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) versionsToUse
);
in
(buildEnv {
Expand Down Expand Up @@ -167,14 +174,19 @@ in
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)
'';
passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}).overrideAttrs
(_: {
Expand Down
22 changes: 17 additions & 5 deletions nix/ext/pg_hashids.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
fetchFromGitHub,
postgresql,
buildEnv,
latestOnly ? false,
}:
let
pname = "pg_hashids";
Expand Down Expand Up @@ -71,9 +72,15 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash (value.revision or name)) supportedVersions
lib.mapAttrs (name: value: build name value.hash (value.revision or name)) versionsToUse
);
in
buildEnv {
Expand All @@ -87,14 +94,19 @@ buildEnv {
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)
'';

passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
22 changes: 17 additions & 5 deletions nix/ext/pg_jsonschema/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
fetchFromGitHub,
postgresql,
rust-bin,
latestOnly ? false,
}:
let
pname = "pg_jsonschema";
Expand Down Expand Up @@ -131,10 +132,16 @@ let
) allVersions;
versions = lib.naturalSort (lib.attrNames supportedVersions);
latestVersion = lib.last versions;
numberOfVersions = builtins.length versions;
versionsToUse =
if latestOnly then
{ "${latestVersion}" = supportedVersions.${latestVersion}; }
else
supportedVersions;
packages = builtins.attrValues (
lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) supportedVersions
lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) versionsToUse
);
versionsBuilt = if latestOnly then [ latestVersion ] else versions;
numberOfVersionsBuilt = builtins.length versionsBuilt;
in
(pkgs.buildEnv {
name = pname;
Expand All @@ -147,7 +154,7 @@ in
# checks
(set -x
test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${
toString (numberOfVersions + 1)
toString (numberOfVersionsBuilt + 1)
}"
)

Expand All @@ -171,9 +178,14 @@ in
'';

passthru = {
inherit versions numberOfVersions pname;
versions = versionsBuilt;
numberOfVersions = numberOfVersionsBuilt;
inherit pname latestOnly;
version =
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
if latestOnly then
latestVersion
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}).overrideAttrs
(_: {
Expand Down
Loading
Loading