| 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 | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 33 | |
| 34 | prepare: |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 35 | pip install --upgrade setuptools |
| 36 | mkdir -p build/ |
| 37 | cp MANIFEST.in build/ |
| 38 | cp requirements.txt build/ |
| 39 | cp README.rst build/ |
| 40 | cp stdeb.cfg build/ |
| 41 | cp kafkad build/ |
| 42 | cp -r core build/ |
| 43 | cp -r plugins build/ |
| 44 | cp -r devops_stages build/ |
| 45 | cp -r test build/ |
| 46 | cp -r scripts build/ |
| 47 | cp setup.py build/ |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 48 | |
| 49 | build: clean openstack_plugins prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 50 | python -m py_compile build/plugins/OpenStack/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 51 | |
| 52 | build: clean vrops_plugins prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 53 | python -m py_compile build/plugins/vRealiseOps/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 54 | |
| prithiv | 063fe7c | 2017-09-29 11:24:41 +0100 | [diff] [blame] | 55 | build: clean cloudwatch_plugins prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 56 | python -m py_compile build/plugins/CloudWatch/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 57 | |
| prithiv | 063fe7c | 2017-09-29 11:24:41 +0100 | [diff] [blame] | 58 | build: clean core prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 59 | python -m py_compile build/core/message_bus/*.py |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 60 | |
| 61 | pip: prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 62 | cd build ./setup.py sdist |
| 63 | cd build ./plugin_setup.py sdist |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 64 | |
| 65 | package: clean clean_deb prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 66 | cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True |
| 67 | cd build/deb_dist/* && dpkg-buildpackage -rfakeroot -uc -us |
| 68 | mkdir -p .build |
| 69 | cp build/deb_dist/python-*.deb .build/ |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 70 | |
| 71 | install: |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 72 | DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| 73 | DEBIAN_FRONTEND=noninteractive apt-get install --yes python-pip && \ |
| 74 | pip install --upgrade pip |
| prithiv | 063fe7c | 2017-09-29 11:24:41 +0100 | [diff] [blame] | 75 | #dpkg -i build/deb_dist/*.deb |
| prithiv | 897fb36 | 2017-09-15 14:59:44 +0100 | [diff] [blame] | 76 | |
| 77 | develop: prepare |
| prithiv | 1e3d6ce | 2017-10-10 13:12:55 +0100 | [diff] [blame] | 78 | pip install -r requirements.txt |
| 79 | cd build && ./setup.py develop |
| 80 | |
| 81 | build-docker-from-source: |
| 82 | docker build -t osm:MON -f docker/Dockerfile |