2021-02-08 20:39:40 +00:00
|
|
|
{ lib
|
2020-08-13 17:20:46 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2021-12-08 11:51:53 +00:00
|
|
|
, promscale
|
2022-04-20 14:40:48 +00:00
|
|
|
, testers
|
2020-08-13 17:20:46 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
2020-09-29 14:18:09 +00:00
|
|
|
pname = "promscale";
|
2023-03-20 08:12:37 +00:00
|
|
|
version = "0.17.0";
|
2020-08-13 17:20:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "timescale";
|
|
|
|
repo = pname;
|
2020-11-01 22:39:49 +00:00
|
|
|
rev = version;
|
2023-10-22 22:38:33 +00:00
|
|
|
hash = "sha256-JizUI9XRzOEHF1kAblYQRYB11z9KWX7od3lPiRN+JNI=";
|
2020-08-13 17:20:46 +00:00
|
|
|
};
|
|
|
|
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-lnyKsipr/f9W9LWLb2lizKGLvIbS3XnSlOH1u1B87OY=";
|
2020-08-13 17:20:46 +00:00
|
|
|
|
2022-01-18 22:34:39 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/timescale/promscale/pkg/version.Version=${version}"
|
|
|
|
"-X github.com/timescale/promscale/pkg/version.CommitHash=${src.rev}"
|
|
|
|
];
|
2023-03-20 08:12:37 +00:00
|
|
|
preBuild = ''
|
|
|
|
# Without this build fails with
|
|
|
|
# main module (github.com/timescale/promscale) does not contain package github.com/timescale/promscale/migration-tool/cmd/prom-migrator
|
|
|
|
rm -r migration-tool
|
|
|
|
'';
|
2022-01-18 23:06:57 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
# some checks requires access to a docker daemon
|
|
|
|
for pkg in $(getGoDirs test | grep -Ev 'testhelpers|upgrade_tests|end_to_end_tests|util'); do
|
|
|
|
buildGoDir test $checkFlags "$pkg"
|
|
|
|
done
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2021-12-08 11:51:53 +00:00
|
|
|
|
2022-04-20 14:40:48 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2021-12-08 11:51:53 +00:00
|
|
|
package = promscale;
|
|
|
|
command = "promscale -version";
|
|
|
|
};
|
2020-08-13 17:20:46 +00:00
|
|
|
|
2021-02-08 20:39:40 +00:00
|
|
|
meta = with lib; {
|
2020-08-13 17:20:46 +00:00
|
|
|
description = "An open-source analytical platform for Prometheus metrics";
|
2020-09-29 14:18:09 +00:00
|
|
|
homepage = "https://github.com/timescale/promscale";
|
2022-01-18 22:34:39 +00:00
|
|
|
changelog = "https://github.com/timescale/promscale/blob/${version}/CHANGELOG.md";
|
2020-08-13 17:20:46 +00:00
|
|
|
license = licenses.asl20;
|
2023-03-20 08:12:37 +00:00
|
|
|
maintainers = with maintainers; [ _0x4A6F anpin ];
|
2020-08-13 17:20:46 +00:00
|
|
|
};
|
|
|
|
}
|