diff options
-rw-r--r-- | COPYING | 4 | ||||
-rw-r--r-- | Makefile | 94 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | awx/__init__.py | 2 | ||||
-rw-r--r-- | awx/settings/defaults.py | 18 | ||||
-rw-r--r-- | awx/settings/development.py | 3 | ||||
-rw-r--r-- | awx/settings/local_settings.py.example | 18 | ||||
-rw-r--r-- | awx/settings/production.py | 1 | ||||
-rw-r--r-- | awx/ui/tests.py | 2 | ||||
-rw-r--r-- | docs/SETUP.md | 59 | ||||
-rw-r--r-- | requirements/Django-1.5.4.tar.gz (renamed from requirements/Django-1.5.2.tar.gz) | bin | 8044778 -> 8050758 bytes | |||
-rw-r--r-- | requirements/astroid-1.0.0.tar.gz | bin | 0 -> 111108 bytes | |||
-rw-r--r-- | requirements/dev.txt | 5 | ||||
-rw-r--r-- | requirements/dev_local.txt | 11 | ||||
-rw-r--r-- | requirements/django-jenkins-0.14.1.tar.gz | bin | 0 -> 32592 bytes | |||
-rw-r--r-- | requirements/logilab-common-0.60.0.tar.gz | bin | 0 -> 202530 bytes | |||
-rw-r--r-- | requirements/pylint-1.0.0.tar.gz | bin | 0 -> 265952 bytes | |||
-rwxr-xr-x | setup.py | 7 | ||||
-rw-r--r-- | tox.ini | 11 |
19 files changed, 110 insertions, 137 deletions
@@ -1,5 +1,5 @@ AWX is commercial software licensed to you under an annual agreement from AnsibleWorks. -It is free for use for up to five managed servers or virtual instances, -after which you must purchase a license. +It is free for use for up to ten managed servers or virtual instances, after +which you must purchase a license. @@ -10,21 +10,23 @@ RELEASE=$(shell $(PYTHON) -c "from awx import __version__; print(__version__.spl ifneq ($(OFFICIAL),yes) BUILD=dev$(DATE) SDIST_TAR_FILE=awx-$(VERSION)-$(BUILD).tar.gz +SETUP_TAR_NAME=awx-setup-$(VERSION)-$(BUILD) RPM_PKG_RELEASE=$(BUILD) DEB_BUILD_DIR=deb-build/awx-$(VERSION)-$(BUILD) DEB_PKG_RELEASE=$(VERSION)-$(BUILD) else BUILD= SDIST_TAR_FILE=awx-$(VERSION).tar.gz +SETUP_TAR_NAME=awx-setup-$(VERSION) RPM_PKG_RELEASE=$(RELEASE) DEB_BUILD_DIR=deb-build/awx-$(VERSION) DEB_PKG_RELEASE=$(VERSION)-$(RELEASE) endif -.PHONY: clean rebase push setup requirements requirements_pypi develop refresh \ +.PHONY: clean rebase push 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 + test_coverage coverage_html test_ui test_jenkins dev_build \ + release_build release_clean sdist rpm # Remove temporary build files, compiled Python files. clean: @@ -42,45 +44,51 @@ rebase: push: git push origin master -# Use Ansible to setup AWX development environment. -setup: - 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) + @if [ "$(VIRTUAL_ENV)" ]; then \ + (cd requirements && pip install --no-index -r dev_local.txt); \ + else \ + (cd requirements && sudo pip install --no-index -r dev_local.txt); \ + fi # Install third-party requirements needed for development environment # (downloading from PyPI if necessary). requirements_pypi: - pip install -r requirements/dev.txt + @if [ "$(VIRTUAL_ENV)" ]; then \ + pip install -r requirements/dev.txt; \ + else \ + sudo pip install -r requirements/dev.txt; \ + fi # "Install" awx package in development mode. Creates link to working # copy in site-packages and installs awx-manage command. develop: - python setup.py develop + @if [ "$(VIRTUAL_ENV)" ]; then \ + $(PYTHON) setup.py develop; \ + else \ + sudo $(PYTHON) setup.py develop; \ + fi # Refresh development environment after pulling new code. refresh: clean requirements develop migrate # Create Django superuser. adduser: - python manage.py createsuperuser + $(PYTHON) manage.py createsuperuser # Create initial database tables (excluding migrations). syncdb: - python manage.py syncdb --noinput + $(PYTHON) manage.py syncdb --noinput # Create database tables and apply any new migrations. -# The first command fixes migrations following cleanup for the 1.2b1 release. migrate: syncdb - -(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) - python manage.py migrate --noinput + $(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 + $(PYTHON) manage.py schemamigration main v14_changes --auto # access database shell, asks for password dbshell: @@ -88,50 +96,58 @@ dbshell: # Run the built-in development webserver (by default on http://localhost:8013). runserver: - python manage.py runserver + $(PYTHON) manage.py runserver # Run to start the background celery worker for development. celeryd: - python manage.py celeryd -l DEBUG -B --autoreload + $(PYTHON) manage.py celeryd -l DEBUG -B --autoreload -# Run all unit tests. +# Run all API unit tests. test: - python manage.py test main + $(PYTHON) manage.py test -v2 main -# Run all unit tests with coverage enabled. +# Run all API unit tests with coverage enabled. test_coverage: - coverage run manage.py test main + coverage run manage.py test -v2 main # Output test coverage as HTML (into htmlcov directory). coverage_html: coverage html +# Run UI unit tests using Selenium. +test_ui: + $(PYTHON) manage.py test -v2 ui + +# Run API unit tests across multiple Python/Django versions with Tox. +test_tox: + tox -v + +# Run unit tests to produce output for Jenkins. +test_jenkins: + $(PYTHON) manage.py jenkins -v2 + +# Build minified JS/CSS. +minjs: + (cd tools/ui/ && ./compile.sh) + # Build a pip-installable package into dist/ with a timestamped version number. -dev_build: - python setup.py dev_build +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 - -release_ball: clean sdist - (cd ../ansible-doc; make) - -(rm -rf awx-$(VERSION)-$(RELEASE)) - mkdir -p awx-$(VERSION)-$(RELEASE)/dist - cp -a dist/* awx-$(VERSION)-$(RELEASE)/dist - mkdir -p awx-$(VERSION)-$(RELEASE)/setup - cp -a setup/* awx-$(VERSION)-$(RELEASE)/setup - mkdir -p awx-$(VERSION)-$(RELEASE)/docs - cp -a ../ansible-doc/*.pdf awx-$(VERSION)-$(RELEASE)/docs - tar -cvf awx-$(VERSION)-$(RELEASE)-all.tar awx-$(VERSION)-$(RELEASE) + $(PYTHON) setup.py release_build + +# Build AWX setup tarball. +setup_tarball: + @cp -a setup $(SETUP_TAR_NAME) + @tar czf $(SETUP_TAR_NAME).tar.gz $(SETUP_TAR_NAME)/ + @rm -rf $(SETUP_TAR_NAME) release_clean: -(rm *.tar) -(rm -rf ($RELEASE)) -minjs: clean - (cd tools/ui/ && ./compile.sh) - sdist: clean minjs if [ "$(OFFICIAL)" = "yes" ] ; then \ $(PYTHON) setup.py release_build; \ @@ -4,11 +4,16 @@ AWX Formerly known as ansible-commander and AnsibleWorks, AWX provides a web-based user interface, REST API and task engine built on top of Ansible. -The current version under development is 1.3, and uses the master branch. +The current version under development is 1.4, and uses the master branch. -1.2.2 was the last released version on July 31st, 2013. +1.2.2 was the initial version released on July 31, 2013. -Hotfixes should go on the appropriate release branch and be cherry-picked to master. +1.3.0 was released on September 15, 2013. + +1.3.1 was released on September 17, 2013. + +Hotfixes should go on the appropriate release branch and be cherry-picked to +master. Resources --------- @@ -18,4 +23,3 @@ Refer to `CONTRIBUTING.md` to get started developing, testing and building AWX. Refer to `setup/README.md` to get started deploying AWX. See `docs/build_system.md` for more about Jenkins and installing nightly builds (as opposed to running from source). - diff --git a/awx/__init__.py b/awx/__init__.py index bae5dd46b9..255db21b11 100644 --- a/awx/__init__.py +++ b/awx/__init__.py @@ -1,7 +1,7 @@ # Copyright (c) 2013 AnsibleWorks, Inc. # All Rights Reserved. -__version__ = '1.3.0-0' +__version__ = '1.4.0-0' import os import sys diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 15ce104881..95f680466a 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -72,7 +72,7 @@ STATIC_URL = '/static/' # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(BASE_DIR, 'public', 'media') # FIXME: Is this where we want it? +MEDIA_ROOT = os.path.join(BASE_DIR, 'public', 'media') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). @@ -103,10 +103,8 @@ TEMPLATE_CONTEXT_PROCESSORS += ( ) MIDDLEWARE_CLASSES += ( -# masking 500 errors do not use for now? -# 'awx.middleware.exceptions.ExceptionMiddleware', 'django.middleware.transaction.TransactionMiddleware', - # middleware loaded after this point will be subject to transactions + # Middleware loaded after this point will be subject to transactions. ) TEMPLATE_DIRS = ( @@ -241,6 +239,14 @@ DEVSERVER_MODULES = ( #'devserver.modules.profile.LineProfilerModule', ) +# Use Django-Jenkins if installed. Only run tests for awx.main app. +try: + import django_jenkins + INSTALLED_APPS += ('django_jenkins',) + PROJECT_APPS = ('awx.main',) +except ImportError: + pass + # Set default ports for live server tests. os.environ.setdefault('DJANGO_LIVE_TEST_SERVER_ADDRESS', 'localhost:9013-9199') @@ -268,18 +274,20 @@ CELERYBEAT_MAX_LOOP_INTERVAL = 60 ANSIBLE_HOST_KEY_CHECKING = False # RHEL has too old of an SSH so ansible will select paramiko and this is VERY -# .slow +# slow. ANSIBLE_PARAMIKO_RECORD_HOST_KEYS = False # Additional environment variables to be passed to the subprocess started by # the celery task. AWX_TASK_ENV = {} +# Internal API URL for use by inventory scripts and callback plugin. if 'devserver' in INSTALLED_APPS: INTERNAL_API_URL = 'http://127.0.0.1:%s' % DEVSERVER_DEFAULT_PORT else: INTERNAL_API_URL = 'http://127.0.0.1:8000' +# Logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': False, diff --git a/awx/settings/development.py b/awx/settings/development.py index 05ada87826..28e2ebbfaf 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -2,12 +2,11 @@ # All Rights Reserved. # Development settings for AWX project. - from defaults import * # If a local_settings.py file is present in awx/settings/, use it to override # default settings for development. If not present, we can still run using -# the defaults. +# only the defaults. try: local_settings_file = os.path.join(os.path.dirname(__file__), 'local_settings.py') diff --git a/awx/settings/local_settings.py.example b/awx/settings/local_settings.py.example index c477465596..b28f61963a 100644 --- a/awx/settings/local_settings.py.example +++ b/awx/settings/local_settings.py.example @@ -4,6 +4,10 @@ # Local Django settings for AWX project. Rename to "local_settings.py" and # edit as needed for your development environment. +# All variables defined in awx/settings/development.py will already be loaded +# into the global namespace before this file is loaded, to allow for reading +# and updating the default settings as needed. + ############################################################################### # MISC PROJECT SETTINGS ############################################################################### @@ -18,15 +22,17 @@ MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'awx', - 'USER': 'awx', - 'PASSWORD': 'AWXsome!', + 'NAME': 'awx-dev', + 'USER': 'awx-dev', + 'PASSWORD': 'AWXsome1', 'HOST': '', 'PORT': '', } } -# Use SQLite for unit tests instead of PostgreSQL. +# Use SQLite for unit tests instead of PostgreSQL. If the lines below are +# commented out, Django will create the awx-dev_test database in PostgreSQL to +# run unit tests. if len(sys.argv) >= 2 and sys.argv[1] == 'test': DATABASES = { 'default': { @@ -237,7 +243,9 @@ AUTH_LDAP_ORGANIZATION_MAP = { ############################################################################### # Define these variables to enable more complete testing of project support for -# SCM updates. +# SCM updates. The test repositories listed do not have to contain any valid +# playbooks. + try: path = os.path.expanduser(os.path.expandvars('~/.ssh/id_rsa')) TEST_SSH_KEY_DATA = file(path, 'rb').read() diff --git a/awx/settings/production.py b/awx/settings/production.py index 87ab321c4f..43c457cb4d 100644 --- a/awx/settings/production.py +++ b/awx/settings/production.py @@ -2,7 +2,6 @@ # All Rights Reserved. # Production settings for AWX project. - from defaults import * DEBUG = False diff --git a/awx/ui/tests.py b/awx/ui/tests.py index 86011c451f..a1a0559729 100644 --- a/awx/ui/tests.py +++ b/awx/ui/tests.py @@ -31,6 +31,8 @@ class UITests(LiveServerTestCase): time.sleep(s) def setUp(self): + if not self.selenium: + self.skipTest('selenium is not installed') self.superuser = User.objects.create_superuser('admin', 'admin@example.com', 'password') def test_login(self, username='admin', password='password'): diff --git a/docs/SETUP.md b/docs/SETUP.md deleted file mode 100644 index 34c30bb9c8..0000000000 --- a/docs/SETUP.md +++ /dev/null @@ -1,59 +0,0 @@ -SETUP -===== - -This will be an ansible playbook soon! - -For now these are instructions for CentOS 6. - -Install ansible-commander -========================= - -Before proceeding, be aware that this should be installed on it's own -machine (or virtualmachine) as it is going to lock down the database. - -Ansible will install ansible-commander using a playbook, so you first -need to have ansible installed. Do this first and come back here. - -You will also need the EPEL yum repository installed if using CentOS6. - -First edit app_setup/vars/vars.yml to select a database password. - -Edit your local settings in app-setup/templates/local_settings.py.j2 -as desired. - -run "make setup" to run the ansible setup playbook. It should run -without erros. - -This playbook will: - - * install Django and required software components - * install postgresql and configure authentication - * initialize the database - * initialize the first database table - * synchronize the database and run any migrations - -You may run this setup step again as needed as many times -as you like. - -Before you login, you must also run "make adduser" to create -a superuser. This will allow you to login to the app. There -is no default user. - -Test the server -=============== - -make runserver - -access the server on 127.0.0.1:8013 - -make celeryd - -to start the celery worker for background tasks - -Running through Apache -====================== - -TODO. - - - diff --git a/requirements/Django-1.5.2.tar.gz b/requirements/Django-1.5.4.tar.gz Binary files differindex 573fbb62df..039e0d1dbb 100644 --- a/requirements/Django-1.5.2.tar.gz +++ b/requirements/Django-1.5.4.tar.gz diff --git a/requirements/astroid-1.0.0.tar.gz b/requirements/astroid-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000000..533b11eebf --- /dev/null +++ b/requirements/astroid-1.0.0.tar.gz diff --git a/requirements/dev.txt b/requirements/dev.txt index 54bf44d9b1..653742d90d 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -22,13 +22,12 @@ Django>=1.4 # Development-only packages: django-debug-toolbar django-devserver +django-jenkins ipython +readline # 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") # - python-ldap (via "yum install python-ldap") -# - coverage (if you want to check test coverage, via "pip install coverage"; -# the default python-coverage package is old.) -# - readline (for using the ipython interactive shell) diff --git a/requirements/dev_local.txt b/requirements/dev_local.txt index 0f0d0e0dbd..18ec0d3f90 100644 --- a/requirements/dev_local.txt +++ b/requirements/dev_local.txt @@ -3,7 +3,7 @@ distribute-0.6.45.tar.gz -Django-1.5.2.tar.gz +Django-1.5.4.tar.gz # The following packages are now bundled with AWX (awx/lib/site-packages): # Needed by python-dateutil, django-extensions: @@ -33,13 +33,16 @@ Django-1.5.2.tar.gz # Remaining dev-only packages: django-debug-toolbar-0.9.4.tar.gz django-devserver-0.6.2.tar.gz +astroid-1.0.0.tar.gz +coverage-3.6.tar.gz +logilab-common-0.60.0.tar.gz +pylint-1.0.0.tar.gz +django-jenkins-0.14.1.tar.gz ipython-1.0.0.tar.gz +readline-6.2.4.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") # - python-ldap (via "yum install python-ldap") -# - 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/django-jenkins-0.14.1.tar.gz b/requirements/django-jenkins-0.14.1.tar.gz Binary files differnew file mode 100644 index 0000000000..656ef7121e --- /dev/null +++ b/requirements/django-jenkins-0.14.1.tar.gz diff --git a/requirements/logilab-common-0.60.0.tar.gz b/requirements/logilab-common-0.60.0.tar.gz Binary files differnew file mode 100644 index 0000000000..1d6f7b2825 --- /dev/null +++ b/requirements/logilab-common-0.60.0.tar.gz diff --git a/requirements/pylint-1.0.0.tar.gz b/requirements/pylint-1.0.0.tar.gz Binary files differnew file mode 100644 index 0000000000..e48a4ed1c1 --- /dev/null +++ b/requirements/pylint-1.0.0.tar.gz @@ -11,7 +11,6 @@ from setuptools.command.sdist import sdist as _sdist from awx import __version__ -#build_timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M') build_timestamp = os.getenv("BUILD",datetime.datetime.now().strftime('-%Y%m%d%H%M')) # Paths we'll use later @@ -117,13 +116,9 @@ setup( packages=['awx'], include_package_data=True, zip_safe=False, - #install_requires=[ - # 'Django>=1.4', - # 'PyYAML', - #], setup_requires=[], classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', @@ -5,8 +5,7 @@ envlist = [testenv] commands = python manage.py test main deps = - ansible==1.2.3 - PyYAML + ansible==1.3.1 python-ldap setenv = DJANGO_SETTINGS_MODULE = awx.settings.development @@ -17,23 +16,23 @@ downloadcache = {toxworkdir}/cache [testenv:py26-dj14] basepython = python2.6 deps = - Django==1.4.7 + Django==1.4.8 {[testenv]deps} [testenv:py27-dj14] basepython = python2.7 deps = - Django==1.4.7 + Django==1.4.8 {[testenv]deps} [testenv:py26-dj15] basepython = python2.6 deps = - Django==1.5.3 + Django==1.5.4 {[testenv]deps} [testenv:py27-dj15] basepython = python2.7 deps = - Django==1.5.3 + Django==1.5.4 {[testenv]deps} |