Makefile 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. virtualenv:
  30. @echo "#############################################"
  31. @echo "# Creating a virtualenv"
  32. @echo "#############################################"
  33. virtualenv $(NAME)env
  34. . $(NAME)env/bin/activate && pip install -r requirements.txt
  35. . $(NAME)env/bin/activate && pip install pep8 nose coverage mock flake8 PyYAML click
  36. # If there are any special things to install do it here
  37. # . $(NAME)env/bin/activate && INSTALL STUFF
  38. ci-unittests:
  39. @echo "#############################################"
  40. @echo "# Running Unit Tests in virtualenv"
  41. @echo "#############################################"
  42. # . $(NAME)env/bin/activate && nosetests -v --with-cover --cover-html --cover-min-percentage=80 --cover-package=$(TESTPACKAGE) test/
  43. . $(NAME)env/bin/activate && nosetests -v test/
  44. ci-pylint:
  45. @echo "#############################################"
  46. @echo "# Running PyLint Tests in virtualenv"
  47. @echo "#############################################"
  48. 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
  49. ci-list-deps:
  50. @echo "#############################################"
  51. @echo "# Listing all pip deps"
  52. @echo "#############################################"
  53. . $(NAME)env/bin/activate && pip freeze
  54. ci-pep8:
  55. @echo "#############################################"
  56. @echo "# Running PEP8 Compliance Tests in virtualenv"
  57. @echo "#############################################"
  58. @echo "Skipping PEP8 tests until we clean them up"
  59. # . $(NAME)env/bin/activate && pep8 --ignore=E501,E121,E124 src/$(SHORTNAME)/
  60. ci-pep8-real:
  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-pylint ci-pep8 ci-unittests
  66. :