Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build scripts for packaging tendrl-monitoring-integration #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include LICENSE
include AUTHORS
include README.rst
include ChangeLog
include version.py
exclude .gitignore
exclude .gitreview
graft docs
graft etc
graft tendrl
global-exclude *.pyc
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
NAME=tendrl-monitoring-integration
VERSION := $(shell PYTHONPATH=. python -c \
'import version; print version.__version__' \
| sed 's/\.dev[0-9]*//')
RELEASE=1
COMMIT := $(shell git rev-parse HEAD)
SHORTCOMMIT := $(shell echo $(COMMIT) | cut -c1-7)

all: srpm

clean:
rm -rf dist/
rm -rf $(NAME)-$(VERSION).tar.gz
rm -rf $(NAME)-$(VERSION)-$(RELEASE).el7.src.rpm

dist:
python setup.py sdist \
&& mv dist/$(NAME)-$(VERSION).tar.gz .

srpm: dist
fedpkg --dist epel7 srpm

rpm: dist
mock -r epel-7-x86_64 rebuild $(NAME)-$(VERSION)-$(RELEASE).el7.src.rpm --resultdir=. --define "dist .el7"

gitversion:
# Set version and release to the latest values from Git
sed -i $(NAME).spec \
-e "/^Release:/cRelease: $(shell date +"%Y%m%dT%H%M%S").$(SHORTCOMMIT)"

snapshot: gitversion srpm


.PHONY: dist rpm srpm gitversion snapshot
53 changes: 53 additions & 0 deletions tendrl-monitoring-integration.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Name: tendrl-monitoring-integration
Version: 1.0.0
Release: 1%{?dist}
BuildArch: noarch
Summary: Module for Tendrl Monitoring Integration
Source0: %{name}-%{version}.tar.gz
License: LGPLv2+
URL: https://github.com/Tendrl/monitoring-integration

#Requires: tendrl-commons
Requires: grafana

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires:
graphite-web
python-carbon
python-whisper


%description
Python module for Tendrl to create a new dashboard in Grafana

%prep
%setup

# Remove bundled egg-info
rm -rf %{name}.egg-info

%build
%{__python} setup.py build

# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
%{__python} setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
install -m 0755 --directory $RPM_BUILD_ROOT%{_var}/log/tendrl/monitoring_integration
install -m 0755 --directory $RPM_BUILD_ROOT%{_sysconfdir}/tendrl/monitoring_integration
#install -Dm 0644 monitoring-integration.service $RPM_BUILD_ROOT%{_unitdir}/monitoring-integration.service
install -Dm 0644 tendrl/monitoring_integration/grafana/grafana.ini $RPM_BUILD_ROOT%{_sysconfdir}/grafana/grafana.ini
install -Dm 0644 graphite.conf.sample.yml $RPM_BUILD_ROOT%{_sysconfdir}/tendrl/monitoring_integration/graphite.conf.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


%post
%preun

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%postun

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

%check
py.test -v tendrl/monitoring_integration/tests || :

%files -f INSTALLED_FILES
%dir %{_var}/log/tendrl/monitoring_integration
%dir %{_sysconfdir}/tendrl/monitoring_integration
%doc README.rst
#%license LICENSE
%config(noreplace) %{_sysconfdir}/tendrl/monitoring_integration/graphite.conf.yml
%config(noreplace) %{_sysconfdir}/grafana/grafana.ini
#%{_unitdir}//monitoring_integration.service

%changelog
* Wed Aug 02 2017 Timothy Asir Jeyasingh <tjeyasin@redhat.com> - 0.0.1-1
- Initial build.