blob: a881380e77aae9b64059727f96b6e7c895ad6687 [file] [log] [blame]
prithiv897fb362017-09-15 14:59:44 +01001# Copyright 2017 Intel Research and Development Ireland Limited
2# *************************************************************
3
4# This file is part of OSM Monitoring module
5# All Rights Reserved to Intel Corporation
6
7# Licensed under the Apache License, Version 2.0 (the "License"); you may
8# not use this file except in compliance with the License. You may obtain
9# a copy of the License at
10
11# http://www.apache.org/licenses/LICENSE-2.0
12
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations
17# under the License.
18
19# For those usages not covered by the Apache License, Version 2.0 please
20# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
21
22#__author__ = "Prithiv Mohan"
23#__date__ = "14/Sep/2017"
24
25SHELL := /bin/bash
26all: package install
27
28clean_deb:
prithiv1e3d6ce2017-10-10 13:12:55 +010029 rm -rf .build
prithiv897fb362017-09-15 14:59:44 +010030
31clean:
prithiv1e3d6ce2017-10-10 13:12:55 +010032 rm -rf build
prithiv71ce7ec2017-11-22 16:46:11 +000033 rm -rf .build
Helena McGough2a237ce2017-12-05 08:23:22 +000034 find . -name '*.pyc' -delete
prithiv897fb362017-09-15 14:59:44 +010035
36prepare:
prithiv71ce7ec2017-11-22 16:46:11 +000037 #apt-get --yes install python-stdeb python-pip libmysqlclient-dev debhelper
38 #pip install --upgrade setuptools
prithiv1e3d6ce2017-10-10 13:12:55 +010039 mkdir -p build/
prithiv71ce7ec2017-11-22 16:46:11 +000040 cp tox.ini build/
prithiv1e3d6ce2017-10-10 13:12:55 +010041 cp MANIFEST.in build/
42 cp requirements.txt build/
prithiv71ce7ec2017-11-22 16:46:11 +000043 cp test-requirements.txt build/
prithiv1e3d6ce2017-10-10 13:12:55 +010044 cp README.rst build/
prithiv1e3d6ce2017-10-10 13:12:55 +010045 cp setup.py build/
prithiv71ce7ec2017-11-22 16:46:11 +000046 cp kafkad build/
prithivc7397b92017-11-23 13:47:34 +000047 cp -r osm_mon build/
prithiv71ce7ec2017-11-22 16:46:11 +000048 cp -r devops-stages build/
49 cp -r scripts build/
50 #pip install -r requirements.txt
51 #pip install -r test-requirements.txt
prithiv897fb362017-09-15 14:59:44 +010052
53build: clean openstack_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000054 python -m py_compile build/osm_mon/plugins/OpenStack/*.py
prithiv897fb362017-09-15 14:59:44 +010055
56build: clean vrops_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000057 python -m py_compile build/osm_mon/plugins/vRealiseOps/*.py
prithiv897fb362017-09-15 14:59:44 +010058
prithiv063fe7c2017-09-29 11:24:41 +010059build: clean cloudwatch_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000060 python -m py_compile build/osm_mon/plugins/CloudWatch/*.py
prithiv897fb362017-09-15 14:59:44 +010061
prithiv063fe7c2017-09-29 11:24:41 +010062build: clean core prepare
prithivc7397b92017-11-23 13:47:34 +000063 python -m py_compile build/osm_mon/core/message_bus/*.py
prithiv897fb362017-09-15 14:59:44 +010064
65pip: prepare
prithiv1e3d6ce2017-10-10 13:12:55 +010066 cd build ./setup.py sdist
prithiv897fb362017-09-15 14:59:44 +010067
68package: clean clean_deb prepare
prithiv71ce7ec2017-11-22 16:46:11 +000069 cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=False bdist_deb
prithiv1e3d6ce2017-10-10 13:12:55 +010070 mkdir -p .build
71 cp build/deb_dist/python-*.deb .build/
prithiv897fb362017-09-15 14:59:44 +010072
prithiv71ce7ec2017-11-22 16:46:11 +000073develop: prepare
74 cd build && ./setup.py develop
75
prithiv897fb362017-09-15 14:59:44 +010076install:
prithiv1e3d6ce2017-10-10 13:12:55 +010077 DEBIAN_FRONTEND=noninteractive apt-get update && \
78 DEBIAN_FRONTEND=noninteractive apt-get install --yes python-pip && \
79 pip install --upgrade pip
prithiv71ce7ec2017-11-22 16:46:11 +000080 dpkg -i build/deb_dist/*.deb
prithiv1e3d6ce2017-10-10 13:12:55 +010081
82build-docker-from-source:
prithiv71ce7ec2017-11-22 16:46:11 +000083 docker build -t osm:MON -f docker/Dockerfile