blob: f789f38f0196f30a2c11b4e597c3ddcb6065e6b1 [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
prithiv897fb362017-09-15 14:59:44 +010034
35prepare:
prithiv71ce7ec2017-11-22 16:46:11 +000036 #apt-get --yes install python-stdeb python-pip libmysqlclient-dev debhelper
37 #pip install --upgrade setuptools
prithiv1e3d6ce2017-10-10 13:12:55 +010038 mkdir -p build/
prithiv71ce7ec2017-11-22 16:46:11 +000039 cp tox.ini build/
prithiv1e3d6ce2017-10-10 13:12:55 +010040 cp MANIFEST.in build/
41 cp requirements.txt build/
prithiv71ce7ec2017-11-22 16:46:11 +000042 cp test-requirements.txt build/
prithiv1e3d6ce2017-10-10 13:12:55 +010043 cp README.rst build/
prithiv1e3d6ce2017-10-10 13:12:55 +010044 cp setup.py build/
prithiv71ce7ec2017-11-22 16:46:11 +000045 cp kafkad build/
prithivc7397b92017-11-23 13:47:34 +000046 cp -r osm_mon build/
prithiv71ce7ec2017-11-22 16:46:11 +000047 cp -r devops-stages build/
48 cp -r scripts build/
49 #pip install -r requirements.txt
50 #pip install -r test-requirements.txt
prithiv897fb362017-09-15 14:59:44 +010051
52build: clean openstack_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000053 python -m py_compile build/osm_mon/plugins/OpenStack/*.py
prithiv897fb362017-09-15 14:59:44 +010054
55build: clean vrops_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000056 python -m py_compile build/osm_mon/plugins/vRealiseOps/*.py
prithiv897fb362017-09-15 14:59:44 +010057
prithiv063fe7c2017-09-29 11:24:41 +010058build: clean cloudwatch_plugins prepare
prithivc7397b92017-11-23 13:47:34 +000059 python -m py_compile build/osm_mon/plugins/CloudWatch/*.py
prithiv897fb362017-09-15 14:59:44 +010060
prithiv063fe7c2017-09-29 11:24:41 +010061build: clean core prepare
prithivc7397b92017-11-23 13:47:34 +000062 python -m py_compile build/osm_mon/core/message_bus/*.py
prithiv897fb362017-09-15 14:59:44 +010063
64pip: prepare
prithiv1e3d6ce2017-10-10 13:12:55 +010065 cd build ./setup.py sdist
prithiv897fb362017-09-15 14:59:44 +010066
67package: clean clean_deb prepare
prithiv71ce7ec2017-11-22 16:46:11 +000068 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 +010069 mkdir -p .build
70 cp build/deb_dist/python-*.deb .build/
prithiv897fb362017-09-15 14:59:44 +010071
prithiv71ce7ec2017-11-22 16:46:11 +000072develop: prepare
73 cd build && ./setup.py develop
74
prithiv897fb362017-09-15 14:59:44 +010075install:
prithiv1e3d6ce2017-10-10 13:12:55 +010076 DEBIAN_FRONTEND=noninteractive apt-get update && \
77 DEBIAN_FRONTEND=noninteractive apt-get install --yes python-pip && \
78 pip install --upgrade pip
prithiv71ce7ec2017-11-22 16:46:11 +000079 dpkg -i build/deb_dist/*.deb
prithiv1e3d6ce2017-10-10 13:12:55 +010080
81build-docker-from-source:
prithiv71ce7ec2017-11-22 16:46:11 +000082 docker build -t osm:MON -f docker/Dockerfile