1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00
awx/setup.py

155 lines
5.6 KiB
Python
Raw Normal View History

2013-05-03 08:14:14 +04:00
#!/usr/bin/env python
2015-06-11 23:05:30 +03:00
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
import os
import datetime
import glob
import sys
import shutil
from setuptools import setup
2013-06-23 21:21:02 +04:00
from awx import __version__
2013-05-03 08:14:14 +04:00
if os.getenv('OFFICIAL', 'no') == 'yes':
build_timestamp = ''
else:
build_timestamp = '-' + os.getenv("BUILD", datetime.datetime.now().strftime('0.git%Y%m%d%H%M'))
2013-06-15 12:10:11 +04:00
# Paths we'll use later
2016-03-23 22:46:00 +03:00
etcpath = "/etc/tower"
2013-06-23 21:21:02 +04:00
homedir = "/var/lib/awx"
2016-03-23 22:46:00 +03:00
bindir = "/usr/bin"
sharedir = "/usr/share/awx"
docdir = "/usr/share/doc/ansible-tower"
2014-07-29 19:44:36 +04:00
munin_plugin_path = "/etc/munin/plugins/"
munin_plugin_conf_path = "/etc/munin/plugin-conf.d"
2013-06-15 12:10:11 +04:00
if os.path.exists("/etc/debian_version"):
sysinit = "/etc/init.d"
webconfig = "/etc/apache2/conf.d"
shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf")
# sosreport-3.1 (and newer) look in '/usr/share/sosreport/sos/plugins'
# sosreport-3.0 looks in '/usr/lib/python2.7/dist-packages/sos/plugins'
# debian/<package>.links will create symlinks to support both versions
sosconfig = "/usr/share/sosreport/sos/plugins"
2013-06-15 12:10:11 +04:00
else:
sysinit = "/etc/rc.d/init.d"
webconfig = "/etc/httpd/conf.d"
shutil.copy("config/awx-munin-el.conf", "config/awx-munin.conf")
# The .spec will create symlinks to support multiple versions of sosreport
sosconfig = "/usr/share/sosreport/sos/plugins"
2013-06-15 12:10:11 +04:00
#####################################################################
# Helper Functions
def explode_glob_path(path):
"""Take a glob and hand back the full recursive expansion,
ignoring links.
"""
result = []
includes = glob.glob(path)
for item in includes:
if os.path.isdir(item) and not os.path.islink(item):
result.extend(explode_glob_path(os.path.join(item, "*")))
else:
result.append(item)
return result
def proc_data_files(data_files):
"""Because data_files doesn't natively support globs...
let's add them.
"""
result = []
2013-06-23 00:30:17 +04:00
# If running in a virtualenv, don't return data files that would install to
# system paths (mainly useful for running tests via tox).
if hasattr(sys, 'real_prefix'):
return result
2013-06-15 12:10:11 +04:00
for dir,files in data_files:
includes = []
for item in files:
includes.extend(explode_glob_path(item))
result.append((dir, includes))
return result
#####################################################################
2013-05-03 08:14:14 +04:00
setup(
2014-01-29 21:30:12 +04:00
name='ansible-tower',
version=__version__.split("-")[0], # FIXME: Should keep full version here?
2014-01-29 21:30:12 +04:00
author='Ansible, Inc.',
author_email='support@ansible.com',
description='ansible-tower: API, UI and Task Engine for Ansible',
2013-06-23 21:21:02 +04:00
long_description='AWX provides a web-based user interface, REST API and '
'task engine built on top of Ansible',
2013-05-03 08:14:14 +04:00
license='Proprietary',
keywords='ansible',
url='http://github.com/ansible/ansible-commander',
2013-06-23 21:21:02 +04:00
packages=['awx'],
2013-05-03 08:14:14 +04:00
include_package_data=True,
zip_safe=False,
setup_requires=[],
classifiers=[
'Development Status :: 5 - Production/Stable',
2013-05-03 08:14:14 +04:00
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators'
'License :: Other/Proprietary License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Systems Administration',
],
entry_points = {
'console_scripts': [
2013-06-23 21:21:02 +04:00
'awx-manage = awx:manage',
2014-07-30 20:56:58 +04:00
'tower-manage = awx:manage',
2013-05-03 08:14:14 +04:00
],
},
2013-06-15 12:10:11 +04:00
data_files = proc_data_files([
("%s" % homedir, ["config/wsgi.py",
"awx/static/favicon.ico"]),
("%s" % webconfig, ["config/awx-httpd-80.conf",
"config/awx-httpd-443.conf",
"config/awx-munin.conf"]),
("%s" % sharedir, ["tools/scripts/request_tower_configuration.sh","tools/scripts/request_tower_configuration.ps1"]),
("%s" % docdir, ["docs/licenses/*",]),
("%s" % munin_plugin_path, ["tools/munin_monitors/tower_jobs",
"tools/munin_monitors/callbackr_alive",
"tools/munin_monitors/celery_alive",
"tools/munin_monitors/postgres_alive",
"tools/munin_monitors/redis_alive",
"tools/munin_monitors/socketio_alive",
2015-06-08 23:23:37 +03:00
"tools/munin_monitors/taskmanager_alive",
"tools/munin_monitors/mongo_conn",
2015-06-08 23:23:37 +03:00
"tools/munin_monitors/mongo_docs",
"tools/munin_monitors/mongo_mem",
"tools/munin_monitors/mongo_ops"]),
("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]),
2016-03-23 22:46:00 +03:00
("%s" % bindir, ["tools/scripts/ansible-tower-service",
"tools/scripts/tower-python"]),
("%s" % sosconfig, ["tools/sosreport/tower.py"])]),
options = {
2013-05-03 08:14:14 +04:00
'egg_info': {
'tag_build': build_timestamp,
2013-05-03 08:14:14 +04:00
},
'aliases': {
'dev_build': 'clean --all egg_info sdist',
'release_build': 'clean --all egg_info -b "" sdist',
2013-05-03 08:14:14 +04:00
},
2016-03-23 22:46:00 +03:00
'build_scripts': {
'executable': '/usr/bin/tower-python',
},
2013-05-03 08:14:14 +04:00
},
)