forked from prometheus/alertmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request prometheus#1 from simonpasquier/cd-build-auto
Modify upstream for auto build
- Loading branch information
Showing
6 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM rhel7:7-released | ||
LABEL maintainer="OpenShift Development <[email protected]>" \ | ||
com.redhat.component="golang-github-prometheus-alertmanager-docker" \ | ||
name="openshift3/prometheus-alertmanager" \ | ||
version="v0.15.0" \ | ||
architecture=x86_64 | ||
|
||
RUN yum-config-manager --enable rhel-7-server-ose-3.9-rpms && \ | ||
yum install -y prometheus-alertmanager && \ | ||
yum clean all | ||
|
||
EXPOSE 9093 | ||
WORKDIR /alertmanager | ||
VOLUME [ "/alertmanager" ] | ||
ENTRYPOINT [ "/bin/alertmanager" ] | ||
CMD [ "--config.file=/etc/alertmanager/config.yml", \ | ||
"--storage.path=/alertmanager" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
%global debug_package %{nil} | ||
|
||
%global provider github | ||
%global provider_tld com | ||
%global project prometheus | ||
%global repo alertmanager | ||
# https://github.com/prometheus/alertmanager | ||
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} | ||
%global import_path %{provider_prefix} | ||
# %commit is intended to be set by tito. The values in this spec file will not be kept up to date. | ||
%{!?commit: | ||
%global commit 5e86f61bd73c6325d6049ab3dbcb468ede26dfe0 | ||
} | ||
%global shortcommit %(c=%{commit}; echo ${c:0:7}) | ||
%global gopathdir %{_sourcedir}/go | ||
%global upstream_ver 0.15.0 | ||
%global rpm_ver %(v=%{upstream_ver}; echo ${v//-/_}) | ||
%global download_prefix %{provider}.%{provider_tld}/openshift/%{repo} | ||
|
||
Name: golang-%{provider}-%{project}-%{repo} | ||
# Version and release information will be automatically managed by CD | ||
# It will be kept in sync with OCP builds. | ||
Version: %{rpm_ver} | ||
Release: 1.git%{shortcommit}%{?dist} | ||
Summary: The Prometheus Alertmanager handles alerts sent by client applications such as the Prometheus server. | ||
License: ASL 2.0 | ||
URL: https://prometheus.io/ | ||
Source0: https://%{download_prefix}/archive/%{commit}/%{repo}-%{commit}.tar.gz | ||
|
||
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required | ||
# promu-based packages FTBFS on aarch64 (#1487462) | ||
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm} ppc64le s390x} | ||
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. | ||
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} | ||
BuildRequires: glibc-static | ||
BuildRequires: prometheus-promu | ||
|
||
%description | ||
%{summary} | ||
|
||
%package -n %{project}-alertmanager | ||
Summary: %{summary} | ||
Provides: prometheus-alertmanager = %{version}-%{release} | ||
Obsoletes: prometheus-alertmanager < %{version}-%{release} | ||
|
||
%description -n %{project}-alertmanager | ||
%{summary} | ||
|
||
%prep | ||
%setup -q -n %{repo}-%{commit} | ||
|
||
%build | ||
# Go expects a full path to the sources which is not included in the source | ||
# tarball so create a link with the expected path | ||
mkdir -p %{gopathdir}/src/%{provider}.%{provider_tld}/%{project} | ||
GOSRCDIR=%{gopathdir}/src/%{import_path} | ||
if [ ! -e "$GOSRCDIR" ]; then | ||
ln -s `pwd` "$GOSRCDIR" | ||
fi | ||
export GOPATH=%{gopathdir} | ||
|
||
make build BUILD_PROMU=false | ||
|
||
%install | ||
install -d %{buildroot}%{_bindir} | ||
install -D -p -m 0755 alertmanager %{buildroot}%{_bindir}/alertmanager | ||
install -D -p -m 0755 amtool %{buildroot}%{_bindir}/amtool | ||
install -D -p -m 0644 doc/examples/simple.yml \ | ||
%{buildroot}%{_sysconfdir}/prometheus/alertmanager.yml | ||
install -D -p -m 0644 prometheus-alertmanager.service \ | ||
%{buildroot}%{_unitdir}/prometheus-alertmanager.service | ||
install -D -p -m 0644 prometheus-alertmanager.sysconfig \ | ||
%{buildroot}%{_sysconfdir}/sysconfig/prometheus-alertmanager | ||
install -d %{buildroot}%{_sharedstatedir}/prometheus-alertmanager | ||
|
||
%files -n %{project}-alertmanager | ||
%license LICENSE NOTICE | ||
%doc CHANGELOG.md CONTRIBUTING.md MAINTAINERS.md README.md | ||
%{_bindir}/alertmanager | ||
%{_bindir}/amtool | ||
%{_sysconfdir}/prometheus/alertmanager.yml | ||
%{_unitdir}/prometheus-alertmanager.service | ||
%{_sysconfdir}/sysconfig/prometheus-alertmanager | ||
%{_sharedstatedir}/prometheus-alertmanager | ||
|
||
%changelog | ||
* Mon Jun 18 2018 Simon Pasquier <[email protected]> - 0.15.0-1 | ||
- Upgrade to 0.15.0 | ||
|
||
* Tue Feb 13 2018 Simon Pasquier <[email protected]> - 0.14.0-1 | ||
- Upgrade to 0.14.0 | ||
|
||
* Wed Jan 31 2018 Paul Gier <[email protected]> - 0.13.0-1 | ||
- Upgrade to 0.13.0 and include amtool | ||
|
||
* Thu Jan 18 2018 Simon Pasquier <[email protected]> - 0.12.0-1 | ||
- Upgrade to 0.12.0 | ||
|
||
* Wed Jan 10 2018 Yaakov Selkowitz <[email protected]> - 0.9.1-3 | ||
- Rebuilt for ppc64le, s390x enablement | ||
|
||
* Wed Nov 08 2017 Paul Gier <[email protected]> - 0.9.1-2 | ||
- upgrade to 0.9.1 | ||
|
||
* Fri Sep 01 2017 Paul Gier <[email protected]> - 0.8.0-2 | ||
- Strip debug and remove duplicate package | ||
|
||
* Fri Aug 25 2017 Paul Gier <[email protected]> - 0.8.0-1 | ||
- First package for Openshift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Prometheus Alertmanager handling alerts sent by client applications such as the Prometheus server. | ||
Documentation=https://github.com/prometheus/alertmanager | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/sysconfig/prometheus-alertmanager | ||
ExecStart=/usr/bin/alertmanager $CONFIG_FILE $STORAGE_PATH $CLUSTER_PEERS $OTHER_ARGS | ||
ExecReload=/bin/kill -SIGHUP $MAINPID | ||
ExecStop=/bin/kill -SIGKILL $MAINPID | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This is a systemd environment file which provides arguments to the systemd | ||
# prometheus alertmanager service. | ||
# For more info see: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile= | ||
|
||
# The location of the configuration file. | ||
CONFIG_FILE="--config.file=/etc/prometheus/alertmanager.yml" | ||
|
||
# The path for storing data. | ||
STORAGE_PATH="--storage.path=/var/lib/prometheus-alertmanager" | ||
|
||
# The list of peers to connect to. | ||
# CLUSTER_PEERS="--cluster.peer=peer1:9094 --cluster.peer=peer2:9094" | ||
CLUSTER_PEERS="" | ||
|
||
# Other arguments. | ||
OTHER_ARGS="" |