diff --git a/Makefile b/Makefile index d264fe9aab..12a0f3aeb1 100644 --- a/Makefile +++ b/Makefile @@ -2,81 +2,94 @@ PYTHON=python SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") RELEASE=ansibleworks-1.2b2 +.PHONY: clean rebase push setup requirements requirements_pypi develop refresh \ + adduser syncdb migrate dbchange dbshell runserver celeryd test \ + test_coverage coverage_html dev_build release_build release_ball \ + release_clean sdist rpm + +# Remove temporary build files, compiled Python files. clean: rm -rf build rpm-build *.egg-info find . -type f -regex ".*\.py[co]$$" -delete +# Fetch from origin, rebase local commits on top of origin commits. rebase: git pull --rebase origin master +# Push changes to origin. push: - git push - -zero: - # go back to original database state, be careful! - python manage.py migrate main zero + git push origin master +# Use Ansible to setup AnsibleWorks development environment. setup: - # use ansible to ansible ansible commander locally ansible-playbook app_setup/setup.yml --verbose -i "127.0.0.1," -c local -e working_dir=`pwd` +# Install third-party requirements needed for development environment (using +# locally downloaded packages). +requirements: + (cd requirements && pip install --no-index -r dev_local.txt) + +# Install third-party requirements needed for development environment +# (downloading from PyPI if necessary). +requirements_pypi: + pip install -r requirements/dev.txt + +# "Install" ansibleworks package in development mode. Creates link to working +# copy in site-packages and installs ansibleworks-manage command. develop: - # "Install" ansibleworks package in development mode. Creates link to - # working copy in site-packages, python setup.py develop -refresh: clean develop syncdb migrate - # update/refresh development environment after pulling new code +# Refresh development environment after pulling new code. +refresh: clean requirements develop migrate +# Create Django superuser. adduser: python manage.py createsuperuser +# Create initial database tables (excluding migrations). syncdb: - # only run from initial setup python manage.py syncdb --noinput -runserver: - # run for testing the server - python manage.py runserver - -celeryd: - # run to start the background celery worker - python manage.py celeryd -l DEBUG -B --autoreload - -# already done and should not have to happen again: -# -#south_init: -# python manage.py schemamigration main --initial - -dbchange: - # run this each time we make changes to the model - python manage.py schemamigration main changes --auto - +# Create database tables and apply any new migrations. +# The first command fixes migrations following cleanup for the 1.2b1 release. migrate: syncdb - # This command fixes migrations following the cleanup for the 1.2b1 release. -(python manage.py migrate main 2>&1 | grep 0017_changes) && (python manage.py migrate main --delete-ghost-migrations --fake 0001_v12b1_initial || python manage.py migrate main --fake) - # run this to apply changes to the model python manage.py migrate --noinput +# Run after making changes to the models to create a new migration. +dbchange: + python manage.py schemamigration main v12b2_changes --auto + +# access database shell +# asks for password # PYTHON_PATH=./acom python acom/manage.py dbshell dbshell: - # access database shell - # asks for password # PYTHON_PATH=./acom python acom/manage.py dbshell sudo -u postgres psql -d acom +# Run the built-in development webserver (by default on http://localhost:8013). +runserver: + python manage.py runserver + +# Run to start the background celery worker for development. +celeryd: + python manage.py celeryd -l DEBUG -B --autoreload + +# Run all unit tests. test: python manage.py test main +# Run all unit tests with coverage enabled. test_coverage: - # Run tests with coverage enabled. coverage run manage.py test main +# Output test coverage as HTML (into htmlcov directory). coverage_html: - # Output test coverage as HTML (into htmlcov directory). coverage html +# Build a pip-installable package into dist/ with a timestamped version number. dev_build: python setup.py dev_build +# Build a pip-installable package into dist/ with the release version number. release_build: python setup.py release_build diff --git a/requirements/coverage-3.6.tar.gz b/requirements/coverage-3.6.tar.gz new file mode 100644 index 0000000000..cd1419eb96 Binary files /dev/null and b/requirements/coverage-3.6.tar.gz differ diff --git a/requirements/dev.txt b/requirements/dev.txt index b76b7e8863..1dde9976ed 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,10 +1,12 @@ -# PIP requirements for AnsibleWorks development/build environment. -# Install using "pip -r dev.txt" +# PIP requirements for AnsibleWorks development/build environment (downloaded +# from PyPI). Install using "pip -r dev.txt". +-U distribute + +# Packages used for development and production: Django>=1.5 django-celery django-extensions -django-filter django-jsonfield django-taggit djangorestframework>=2.3.0,<2.4.0 @@ -14,6 +16,7 @@ python-dateutil requests South>=0.8,<2.0 +# Development-only packages: django-debug-toolbar django-devserver ipython @@ -21,8 +24,6 @@ ipython # You may also need to install the following extra packages using the OS # package manager, or pip if you're running inside a virtualenv. # - ansible (via yum, pip or source checkout) -# - distribute (Use the latest version via "pip install -U distribute"; the -# default python-setuptools package is old.) # - psycopg2 (via "yum install python-psycopg2") # - coverage (if you want to check test coverage, via "pip install coverage"; # the default python-coverage package is old.) diff --git a/requirements/dev_local.txt b/requirements/dev_local.txt new file mode 100644 index 0000000000..fc81d67488 --- /dev/null +++ b/requirements/dev_local.txt @@ -0,0 +1,46 @@ +# PIP requirements for AnsibleWorks development/build environment (using only +# local packages). Install using "pip --no-index -r dev_local.txt". + +distribute-0.6.45.tar.gz + +Django-1.5.1.tar.gz + +# Needed by python-dateutil, django-extensions: +six-1.3.0.tar.gz + +# Needed by kombu: +amqp-1.0.11.tar.gz +anyjson-0.3.3.tar.gz + +# Needed by celery: +billiard-2.7.3.28.tar.gz +kombu-2.5.10.tar.gz +python-dateutil-2.1.tar.gz + +# Needed by django-celery: +celery-3.0.19.tar.gz +pytz-2013b.tar.gz + +# Remaining dev/prod packages: +django-celery-3.0.17.tar.gz +django-extensions-1.1.1.tar.gz +django-jsonfield-0.9.10.tar.gz +django-taggit-0.10a1.tar.gz +djangorestframework-2.3.5.tar.gz +Markdown-2.3.1.tar.gz +pexpect-2.4.tar.gz +requests-1.2.3.tar.gz +South-0.8.1.tar.gz + +# Remaining dev-only packages: +django-debug-toolbar-0.9.4.tar.gz +django-devserver-0.6.2.tar.gz +ipython-0.13.2.zip + +# You may also need to install the following extra packages using the OS +# package manager, or pip if you're running inside a virtualenv. +# - ansible (via yum, pip or source checkout) +# - psycopg2 (via "yum install python-psycopg2") +# - coverage-3.6.tar.gz (if you want to check test coverage; the default +# python-coverage package is old.) +# - readline-6.2.4.1.tar.gz (for using the ipython interactive shell) diff --git a/requirements/distribute-0.6.45.tar.gz b/requirements/distribute-0.6.45.tar.gz new file mode 100644 index 0000000000..1b88242f98 Binary files /dev/null and b/requirements/distribute-0.6.45.tar.gz differ diff --git a/requirements/django-jsonfield-0.9.10.tar.gz b/requirements/django-jsonfield-0.9.10.tar.gz new file mode 100644 index 0000000000..67fabb140c Binary files /dev/null and b/requirements/django-jsonfield-0.9.10.tar.gz differ diff --git a/requirements/django-jsonfield-0.9.4.tar.gz b/requirements/django-jsonfield-0.9.4.tar.gz deleted file mode 100644 index f3dc727c4a..0000000000 Binary files a/requirements/django-jsonfield-0.9.4.tar.gz and /dev/null differ diff --git a/requirements/prod.txt b/requirements/prod.txt new file mode 100644 index 0000000000..379d79b9ac --- /dev/null +++ b/requirements/prod.txt @@ -0,0 +1,19 @@ +# PIP requirements for AnsibleWorks production environment (downloaded from +# PyPI). Install using "pip -r prod.txt". + +Django>=1.5 +django-celery +django-extensions +django-jsonfield +django-taggit +djangorestframework>=2.3.0,<2.4.0 +Markdown +pexpect +python-dateutil +requests +South>=0.8,<2.0 + +# You may also need to install the following extra packages using the OS +# package manager, or pip if you're running inside a virtualenv. +# - ansible (via yum, pip or source checkout) +# - psycopg2 (via "yum install python-psycopg2") diff --git a/requirements/prod_local.txt b/requirements/prod_local.txt new file mode 100644 index 0000000000..03f3c0373a --- /dev/null +++ b/requirements/prod_local.txt @@ -0,0 +1,36 @@ +# PIP requirements for AnsibleWorks production environment (using only local +# packages). Install using "pip --no-index -r prod_local.txt". + +Django-1.5.1.tar.gz + +# Needed by python-dateutil, django-extensions: +six-1.3.0.tar.gz + +# Needed by kombu: +amqp-1.0.11.tar.gz +anyjson-0.3.3.tar.gz + +# Needed by celery: +billiard-2.7.3.28.tar.gz +kombu-2.5.10.tar.gz +python-dateutil-2.1.tar.gz + +# Needed by django-celery: +celery-3.0.19.tar.gz +pytz-2013b.tar.gz + +# Remaining packages: +django-celery-3.0.17.tar.gz +django-extensions-1.1.1.tar.gz +django-jsonfield-0.9.10.tar.gz +django-taggit-0.10a1.tar.gz +djangorestframework-2.3.5.tar.gz +Markdown-2.3.1.tar.gz +pexpect-2.4.tar.gz +requests-1.2.3.tar.gz +South-0.8.1.tar.gz + +# You may also need to install the following extra packages using the OS +# package manager, or pip if you're running inside a virtualenv. +# - ansible (via yum, pip or source checkout) +# - psycopg2 (via "yum install python-psycopg2") diff --git a/requirements/readline-6.2.4.1.tar.gz b/requirements/readline-6.2.4.1.tar.gz new file mode 100644 index 0000000000..9074843090 Binary files /dev/null and b/requirements/readline-6.2.4.1.tar.gz differ