| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 1 | # 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 | |
| 25 | SHELL := /bin/bash |
| 26 | all: package install |
| 27 | |
| 28 | clean_deb: |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 29 | rm -rf .build |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 30 | |
| 31 | clean: |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 32 | rm -rf build |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 33 | rm -rf .build |
| Helena McGough | 2a237ce | 2017-12-05 08:23:22 +0000 | [diff] [blame^] | 34 | find . -name '*.pyc' -delete |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 35 | |
| 36 | prepare: |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 37 | #apt-get --yes install python-stdeb python-pip libmysqlclient-dev debhelper |
| 38 | #pip install --upgrade setuptools |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 39 | mkdir -p build/ |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 40 | cp tox.ini build/ |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 41 | cp MANIFEST.in build/ |
| 42 | cp requirements.txt build/ |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 43 | cp test-requirements.txt build/ |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 44 | cp README.rst build/ |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 45 | cp setup.py build/ |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 46 | cp kafkad build/ |
| prithiv | c7397b9 | 2017-11-23 13:47:34 +0000 | [diff] [blame] | 47 | cp -r osm_mon build/ |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 48 | cp -r devops-stages build/ |
| 49 | cp -r scripts build/ |
| 50 | #pip install -r requirements.txt |
| 51 | #pip install -r test-requirements.txt |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 52 | |
| 53 | build: clean openstack_plugins prepare |
| prithiv | c7397b9 | 2017-11-23 13:47:34 +0000 | [diff] [blame] | 54 | python -m py_compile build/osm_mon/plugins/OpenStack/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 55 | |
| 56 | build: clean vrops_plugins prepare |
| prithiv | c7397b9 | 2017-11-23 13:47:34 +0000 | [diff] [blame] | 57 | python -m py_compile build/osm_mon/plugins/vRealiseOps/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 58 | |
| prithiv | 063fe7c | 2017-09-29 11:24:41 +0100 | [diff] [blame] | 59 | build: clean cloudwatch_plugins prepare |
| prithiv | c7397b9 | 2017-11-23 13:47:34 +0000 | [diff] [blame] | 60 | python -m py_compile build/osm_mon/plugins/CloudWatch/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 61 | |
| prithiv | 063fe7c | 2017-09-29 11:24:41 +0100 | [diff] [blame] | 62 | build: clean core prepare |
| prithiv | c7397b9 | 2017-11-23 13:47:34 +0000 | [diff] [blame] | 63 | python -m py_compile build/osm_mon/core/message_bus/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 64 | |
| 65 | pip: prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 66 | cd build ./setup.py sdist |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 67 | |
| 68 | package: clean clean_deb prepare |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 69 | cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=False bdist_deb |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 70 | mkdir -p .build |
| 71 | cp build/deb_dist/python-*.deb .build/ |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 72 | |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 73 | develop: prepare |
| 74 | cd build && ./setup.py develop |
| 75 | |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 76 | install: |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 77 | DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| 78 | DEBIAN_FRONTEND=noninteractive apt-get install --yes python-pip && \ |
| 79 | pip install --upgrade pip |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 80 | dpkg -i build/deb_dist/*.deb |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 81 | |
| 82 | build-docker-from-source: |
| prithiv | 71ce7ec | 2017-11-22 16:46:11 +0000 | [diff] [blame] | 83 | docker build -t osm:MON -f docker/Dockerfile |