mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Adding ability to run "make rpm"
This commit is contained in:
parent
c6cb86321e
commit
ca4050aee8
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ env/*
|
||||
build
|
||||
dist
|
||||
htmlcov
|
||||
rpm-build
|
||||
*.egg-info
|
||||
*.py[c,o]
|
||||
*.swp
|
||||
|
||||
@ -4,6 +4,7 @@ recursive-include ansibleworks/templates *.html
|
||||
recursive-include ansibleworks/ui *.html *.js
|
||||
recursive-include ansibleworks/ui/static *.css *.ico *.png *.gif *.jpg
|
||||
recursive-include ansibleworks/ui/static *.eot *.svg *.ttf *.woff *.otf
|
||||
recursive-include config *
|
||||
recursive-exclude ansibleworks/settings local_settings.py
|
||||
include *.py *.txt *.md
|
||||
include MANIFEST.in
|
||||
|
||||
22
Makefile
22
Makefile
@ -1,7 +1,9 @@
|
||||
RELEASE = ansibleworks-1.2b2
|
||||
PYTHON=python
|
||||
SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
|
||||
RELEASE=ansibleworks-1.2b2
|
||||
|
||||
clean:
|
||||
rm -rf build *.egg-info
|
||||
rm -rf build rpm-build *.egg-info
|
||||
find . -type f -regex ".*\.py[co]$$" -delete
|
||||
|
||||
rebase:
|
||||
@ -93,3 +95,19 @@ release_ball: clean
|
||||
release_clean:
|
||||
-(rm *.tar)
|
||||
-(rm -rf ($RELEASE))
|
||||
|
||||
sdist: clean
|
||||
$(PYTHON) setup.py release_build
|
||||
|
||||
rpm: sdist
|
||||
@mkdir -p rpm-build
|
||||
@cp dist/*.gz rpm-build/
|
||||
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
|
||||
--define "_builddir %{_topdir}" \
|
||||
--define "_rpmdir %{_topdir}" \
|
||||
--define "_srcrpmdir %{_topdir}" \
|
||||
--define "_specdir %{_topdir}" \
|
||||
--define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \
|
||||
--define "_sourcedir %{_topdir}" \
|
||||
-ba packaging/rpm/ansibleworks.spec
|
||||
|
||||
|
||||
32
config/ansibleworks.conf
Normal file
32
config/ansibleworks.conf
Normal file
@ -0,0 +1,32 @@
|
||||
NameVirtualHost *:80
|
||||
WSGISocketPrefix run/wsgi
|
||||
|
||||
<VirtualHost _default_:80>
|
||||
ServerName localhost
|
||||
ServerAlias localhost
|
||||
ServerAlias 127.0.0.1
|
||||
DocumentRoot /var/lib/ansibleworks/public
|
||||
|
||||
WSGIScriptAlias / /var/lib/ansibleworks/wsgi.py
|
||||
WSGIPassAuthorization On
|
||||
|
||||
# FIXME: May want to tune these parameters after performance testing.
|
||||
WSGIDaemonProcess ansibleworks user=ansibleworks group=ansibleworks processes=2 threads=20 maximum-requests=1000 display-name="%{GROUP}"
|
||||
WSGIProcessGroup ansibleworks
|
||||
|
||||
Alias /favicon.ico /var/lib/ansibleworks/public/static/favicon.ico
|
||||
Alias /static/ /var/lib/ansibleworks/public/static/
|
||||
|
||||
<Directory /var/lib/ansibleworks/>
|
||||
<Files wsgi.py>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Files>
|
||||
</Directory>
|
||||
|
||||
<Directory /var/lib/ansibleworks/public/>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
</VirtualHost>
|
||||
41
config/settings.py
Normal file
41
config/settings.py
Normal file
@ -0,0 +1,41 @@
|
||||
ADMINS = (
|
||||
#('Joe Admin', 'joeadmin@example.com'),
|
||||
)
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'ansibleworks',
|
||||
'USER': 'ansibleworks',
|
||||
'PASSWORD': 'AWsecret',
|
||||
'HOST': '',
|
||||
'PORT': '',
|
||||
}
|
||||
}
|
||||
|
||||
STATIC_ROOT = '/var/lib/ansibleworks/public/static'
|
||||
|
||||
PROJECTS_ROOT = '/var/lib/ansibleworks/projects'
|
||||
|
||||
SECRET_KEY = file('/etc/ansibleworks/SECRET_KEY', 'rb').read().strip()
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
LOGGING['handlers']['syslog'] = {
|
||||
'level': 'ERROR',
|
||||
'filters': ['require_debug_false'],
|
||||
'class': 'logging.handlers.SysLogHandler',
|
||||
'address': '/dev/log',
|
||||
'facility': 'local0',
|
||||
'formatter': 'simple',
|
||||
}
|
||||
|
||||
SERVER_EMAIL = 'root@localhost'
|
||||
DEFAULT_FROM_EMAIL = 'webmaster@localhost'
|
||||
EMAIL_SUBJECT_PREFIX = '[AnsibleWorks] '
|
||||
|
||||
EMAIL_HOST = 'localhost'
|
||||
EMAIL_PORT = 25
|
||||
EMAIL_HOST_USER = ''
|
||||
EMAIL_HOST_PASSWORD = ''
|
||||
EMAIL_USE_TLS = False
|
||||
54
setup.py
54
setup.py
@ -3,16 +3,57 @@
|
||||
# Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import datetime
|
||||
import os, datetime, glob
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
from ansibleworks import __version__
|
||||
|
||||
build_timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M')
|
||||
|
||||
# Paths we'll use later
|
||||
etcpath = "/etc/ansibleworks"
|
||||
homedir = "/var/lib/ansibleworks"
|
||||
if os.path.exists("/etc/debian_version"):
|
||||
webconfig = "/etc/apache2/conf.d"
|
||||
else:
|
||||
webconfig = "/etc/httpd/conf.d"
|
||||
|
||||
#####################################################################
|
||||
# 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 = []
|
||||
for dir,files in data_files:
|
||||
includes = []
|
||||
for item in files:
|
||||
includes.extend(explode_glob_path(item))
|
||||
result.append((dir, includes))
|
||||
return result
|
||||
|
||||
#####################################################################
|
||||
|
||||
setup(
|
||||
name='ansibleworks',
|
||||
version=__version__,
|
||||
version=__version__.split("-")[0],
|
||||
author='AnsibleWorks, Inc.',
|
||||
author_email='support@ansibleworks.com',
|
||||
description='AnsibleWorks API, UI and Task Engine',
|
||||
@ -57,6 +98,14 @@ setup(
|
||||
'ansibleworks-manage = ansibleworks:manage',
|
||||
],
|
||||
},
|
||||
data_files = proc_data_files([
|
||||
("%s" % homedir, ["ansibleworks/wsgi.py",
|
||||
"ansibleworks/static/favicon.ico",
|
||||
]),
|
||||
("%s" % etcpath, ["config/settings.py"]),
|
||||
("%s" % webconfig, ["config/ansibleworks.conf"]),
|
||||
]
|
||||
),
|
||||
options={
|
||||
'egg_info': {
|
||||
'tag_build': '-dev%s' % build_timestamp,
|
||||
@ -67,3 +116,4 @@ setup(
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user