Makefile 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ########################################################
  2. # Makefile for OpenShift: Atomic Quick Installer
  3. #
  4. # useful targets (not all implemented yet!):
  5. # make clean -- Clean up garbage
  6. # make ci ------------------- Execute CI steps (for travis or jenkins)
  7. ########################################################
  8. # > VARIABLE = value
  9. #
  10. # Normal setting of a variable - values within it are recursively
  11. # expanded when the variable is USED, not when it's declared.
  12. #
  13. # > VARIABLE := value
  14. #
  15. # Setting of a variable with simple expansion of the values inside -
  16. # values within it are expanded at DECLARATION time.
  17. ########################################################
  18. NAME := oo-install
  19. TESTPACKAGE := oo-install
  20. SHORTNAME := ooinstall
  21. sdist: clean
  22. python setup.py sdist
  23. rm -fR $(SHORTNAME).egg-info
  24. clean:
  25. @find . -type f -regex ".*\.py[co]$$" -delete
  26. @find . -type f \( -name "*~" -or -name "#*" \) -delete
  27. @rm -fR build dist rpm-build MANIFEST htmlcov .coverage cover ooinstall.egg-info oo-install
  28. @rm -fR $(NAME)env
  29. viewcover:
  30. xdg-open cover/index.html
  31. virtualenv:
  32. @echo "#############################################"
  33. @echo "# Creating a virtualenv"
  34. @echo "#############################################"
  35. virtualenv $(NAME)env
  36. . $(NAME)env/bin/activate && pip install -r requirements.txt
  37. # If there are any special things to install do it here
  38. # . $(NAME)env/bin/activate && INSTALL STUFF
  39. ci-unittests:
  40. @echo "#############################################"
  41. @echo "# Running Unit Tests in virtualenv"
  42. @echo "#############################################"
  43. . $(NAME)env/bin/activate && nosetests -v --with-coverage --cover-html --cover-min-percentage=70 --cover-package=$(SHORTNAME) test/
  44. @echo "VIEW CODE COVERAGE REPORT WITH 'xdg-open cover/index.html' or run 'make viewcover'"
  45. ci-pylint:
  46. @echo "#############################################"
  47. @echo "# Running PyLint Tests in virtualenv"
  48. @echo "#############################################"
  49. . $(NAME)env/bin/activate && python -m pylint --rcfile ../git/.pylintrc src/ooinstall/cli_installer.py src/ooinstall/oo_config.py src/ooinstall/openshift_ansible.py src/ooinstall/variants.py
  50. ci-list-deps:
  51. @echo "#############################################"
  52. @echo "# Listing all pip deps"
  53. @echo "#############################################"
  54. . $(NAME)env/bin/activate && pip freeze
  55. ci-pyflakes:
  56. @echo "#################################################"
  57. @echo "# Running Pyflakes Compliance Tests in virtualenv"
  58. @echo "#################################################"
  59. . $(NAME)env/bin/activate && pyflakes src/ooinstall/*.py
  60. ci-pep8:
  61. @echo "#############################################"
  62. @echo "# Running PEP8 Compliance Tests in virtualenv"
  63. @echo "#############################################"
  64. . $(NAME)env/bin/activate && pep8 --ignore=E501,E121,E124 src/$(SHORTNAME)/
  65. ci: clean virtualenv ci-list-deps ci-pep8 ci-pylint ci-pyflakes ci-unittests
  66. :