diff --git a/ceph-dashboard-pull-requests/config/definitions/ceph-dashboard-pull-requests.yml b/ceph-dashboard-pull-requests/config/definitions/ceph-dashboard-pull-requests.yml index 94f247a4e..ec4629a62 100644 --- a/ceph-dashboard-pull-requests/config/definitions/ceph-dashboard-pull-requests.yml +++ b/ceph-dashboard-pull-requests/config/definitions/ceph-dashboard-pull-requests.yml @@ -62,4 +62,6 @@ - shell: !include-raw: - ../../../scripts/dashboard/install-e2e-test-deps.sh + - ../../../scripts/dashboard/install-prometheus-and-alertmanager.sh - shell: "cd src/pybind/mgr/dashboard; timeout 7200 ./run-frontend-e2e-tests.sh" + - shell: pkill prometheus && pkill alertmanager diff --git a/scripts/dashboard/install-prometheus-and-alertmanager.sh b/scripts/dashboard/install-prometheus-and-alertmanager.sh new file mode 100644 index 000000000..67edb522d --- /dev/null +++ b/scripts/dashboard/install-prometheus-and-alertmanager.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -ex + +# Install and run Prometheus +# Use $WORKSPACE dir since it will be wiped after the job has completed +cd $WORKSPACE +sudo mkdir prometheus +cd prometheus +sudo curl -LO https://github.com/prometheus/prometheus/releases/download/v2.15.2/prometheus-2.15.2.linux-amd64.tar.gz +sudo tar xf prometheus-2.15.2.linux-amd64.tar.gz +cd prometheus/prometheus-2.15.2.linux-amd64 + +sudo ./prometheus & + +cd $WORKDIR + +# Install and run Alertmanager +sudo mkdir alertmanager +cd alertmanager +sudo curl -LO https://github.com/prometheus/alertmanager/releases/download/v0.20.0/alertmanager-0.20.0.linux-amd64.tar.gz +sudo tar xf alertmanager-0.20.0.linux-amd64.tar.gz +cd alertmanager/alertmanager-0.20.0.linux-amd64 + +sudo ./alertmanager & + +# "pkill prometheus" and "pkill alertmanager" must be executed in the Jenkins job that uses this script