mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
AC-474. Updates to contributing doc, along with related Makefile, testing and settings changes.
This commit is contained in:
4
COPYING
4
COPYING
@@ -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.
|
||||
|
||||
92
Makefile
92
Makefile
@@ -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
|
||||
$(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)
|
||||
# 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; \
|
||||
|
||||
12
README.md
12
README.md
@@ -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).
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# All Rights Reserved.
|
||||
|
||||
# Production settings for AWX project.
|
||||
|
||||
from defaults import *
|
||||
|
||||
DEBUG = False
|
||||
|
||||
@@ -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'):
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
BIN
requirements/astroid-1.0.0.tar.gz
Normal file
BIN
requirements/astroid-1.0.0.tar.gz
Normal file
Binary file not shown.
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
BIN
requirements/django-jenkins-0.14.1.tar.gz
Normal file
BIN
requirements/django-jenkins-0.14.1.tar.gz
Normal file
Binary file not shown.
BIN
requirements/logilab-common-0.60.0.tar.gz
Normal file
BIN
requirements/logilab-common-0.60.0.tar.gz
Normal file
Binary file not shown.
BIN
requirements/pylint-1.0.0.tar.gz
Normal file
BIN
requirements/pylint-1.0.0.tar.gz
Normal file
Binary file not shown.
7
setup.py
7
setup.py
@@ -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',
|
||||
|
||||
11
tox.ini
11
tox.ini
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user