Merge pull request #150966 from sir4ur0n/sir4ur0n/addLiquibaseRedshiftSupport

liquibase: add support for Amazon Redshift
This commit is contained in:
Timo Kaufmann 2022-04-29 21:09:24 +02:00 committed by GitHub
commit dc421ee748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 6 deletions

View file

@ -0,0 +1,27 @@
{ lib, stdenv, fetchMavenArtifact }:
stdenv.mkDerivation rec {
pname = "liquibase-redshift-extension";
version = "4.8.0";
src = fetchMavenArtifact {
artifactId = "liquibase-redshift";
groupId = "org.liquibase.ext";
sha256 = "sha256-jZdDKAC4Cvmkih8VH84Z3Q8BzsqGO55Uefr8vOlbDAk=";
inherit version;
};
installPhase = ''
runHook preInstall
install -m444 -D $src/share/java/liquibase-redshift-${version}.jar $out/share/java/liquibase-redshift.jar
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/liquibase/liquibase-redshift/";
description = "Amazon Redshift extension for Liquibase";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ sir4ur0n ];
};
}

View file

@ -0,0 +1,28 @@
{ lib, stdenv, fetchMavenArtifact }:
stdenv.mkDerivation rec {
pname = "redshift-jdbc";
version = "2.1.0.3";
src = fetchMavenArtifact {
artifactId = "redshift-jdbc42";
groupId = "com.amazon.redshift";
sha256 = "sha256-TO/JXh/pZ7tUZGfHqkzgZx18gLnISvnPVyGavzFv6vo=";
inherit version;
};
installPhase = ''
runHook preInstall
install -m444 -D $src/share/java/redshift-jdbc42-${version}.jar $out/share/java/redshift-jdbc42.jar
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/aws/amazon-redshift-jdbc-driver/";
description =
"JDBC 4.2 driver for Amazon Redshift allowing Java programs to connect to a Redshift database";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ sir4ur0n ];
};
}

View file

@ -1,11 +1,25 @@
{ lib, stdenv, fetchurl, jre, makeWrapper
, mysqlSupport ? true, mysql_jdbc
, postgresqlSupport ? true, postgresql_jdbc }:
{ lib
, stdenv
, fetchurl
, jre
, makeWrapper
, mysqlSupport ? true
, mysql_jdbc
, postgresqlSupport ? true
, postgresql_jdbc
, redshiftSupport ? true
, redshift_jdbc
, liquibase_redshift_extension
}:
let
extraJars =
lib.optional mysqlSupport mysql_jdbc
++ lib.optional postgresqlSupport postgresql_jdbc;
++ lib.optional postgresqlSupport postgresql_jdbc
++ lib.optionals redshiftSupport [
redshift_jdbc
liquibase_redshift_extension
];
in
stdenv.mkDerivation rec {
@ -30,7 +44,8 @@ stdenv.mkDerivation rec {
CP="\$CP":"\$jar"
done
'';
in ''
in
''
mkdir -p $out
mv ./{lib,licenses,liquibase.jar} $out/
@ -54,7 +69,7 @@ stdenv.mkDerivation rec {
liquibase.integration.commandline.Main \''${1+"\$@"}
EOF
chmod +x $out/bin/liquibase
'';
'';
meta = with lib; {
description = "Version Control for your database";

View file

@ -22309,6 +22309,10 @@ with pkgs;
postgresqlTestHook = callPackage ../build-support/setup-hooks/postgresql-test-hook { };
redshift_jdbc = callPackage ../development/java-modules/redshift_jdbc { };
liquibase_redshift_extension = callPackage ../development/java-modules/liquibase_redshift_extension { };
prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { };
prometheus = callPackage ../servers/monitoring/prometheus { buildGoModule = buildGo118Module; };
prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { };