Merge pull request #208511 from e1mo/fix-prometheus-xmpp-alerts-regression
This commit is contained in:
commit
511f9544cc
1 changed files with 21 additions and 0 deletions
|
@ -2,6 +2,9 @@
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, python3Packages
|
, python3Packages
|
||||||
, prometheus-alertmanager
|
, prometheus-alertmanager
|
||||||
|
, fetchpatch
|
||||||
|
, runCommand
|
||||||
|
, prometheus-xmpp-alerts
|
||||||
}:
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
|
@ -15,6 +18,16 @@ python3Packages.buildPythonApplication rec {
|
||||||
sha256 = "sha256-PwShGS1rbfZCK5OS6Cnn+mduOpWAD4fC69mcGB5GB1c=";
|
sha256 = "sha256-PwShGS1rbfZCK5OS6Cnn+mduOpWAD4fC69mcGB5GB1c=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# Required until https://github.com/jelmer/prometheus-xmpp-alerts/pull/33 is merged
|
||||||
|
# and contained in a release
|
||||||
|
(fetchpatch {
|
||||||
|
name = "Fix-outdated-entrypoint-definiton.patch";
|
||||||
|
url = "https://github.com/jelmer/prometheus-xmpp-alerts/commit/c41dd41dbd3c781b874bcf0708f6976e6252b621.patch";
|
||||||
|
hash = "sha256-G7fRLSXbkI5EDgGf4n9xSVs54IPD0ev8rTEFffRvLY0=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace setup.cfg \
|
substituteInPlace setup.cfg \
|
||||||
--replace "bs4" "beautifulsoup4"
|
--replace "bs4" "beautifulsoup4"
|
||||||
|
@ -39,6 +52,14 @@ python3Packages.buildPythonApplication rec {
|
||||||
|
|
||||||
pythonImportsCheck = [ "prometheus_xmpp" ];
|
pythonImportsCheck = [ "prometheus_xmpp" ];
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
binaryWorks = runCommand "${pname}-binary-test" {} ''
|
||||||
|
# Running with --help to avoid it erroring due to a missing config file
|
||||||
|
${prometheus-xmpp-alerts}/bin/prometheus-xmpp-alerts --help | tee $out
|
||||||
|
grep "usage: prometheus-xmpp-alerts" $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "XMPP Web hook for Prometheus";
|
description = "XMPP Web hook for Prometheus";
|
||||||
homepage = "https://github.com/jelmer/prometheus-xmpp-alerts";
|
homepage = "https://github.com/jelmer/prometheus-xmpp-alerts";
|
||||||
|
|
Loading…
Reference in a new issue