2018-11-13 21:55:59 +01:00
|
|
|
|
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
import os
|
|
|
|
|
import glob
|
|
|
|
|
import configparser
|
|
|
|
|
import re
|
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
|
|
conf = []
|
|
|
|
|
templates = []
|
|
|
|
|
|
2019-08-15 17:19:52 +02:00
|
|
|
long_description = '''WordOps An essential toolset that eases WordPress
|
|
|
|
|
site and server administration. It provide the ability
|
|
|
|
|
to Install a high performance WordPress stack
|
|
|
|
|
with a few keystrokes'''
|
2018-11-13 21:55:59 +01:00
|
|
|
|
|
|
|
|
for name in glob.glob('config/plugins.d/*.conf'):
|
|
|
|
|
conf.insert(1, name)
|
|
|
|
|
|
|
|
|
|
for name in glob.glob('wo/cli/templates/*.mustache'):
|
|
|
|
|
templates.insert(1, name)
|
|
|
|
|
|
|
|
|
|
if not os.path.exists('/var/log/wo/'):
|
|
|
|
|
os.makedirs('/var/log/wo/')
|
|
|
|
|
|
|
|
|
|
if not os.path.exists('/var/lib/wo/'):
|
|
|
|
|
os.makedirs('/var/lib/wo/')
|
|
|
|
|
|
|
|
|
|
# WordOps git configuration management
|
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
|
config.read(os.path.expanduser("~")+'/.gitconfig')
|
|
|
|
|
try:
|
|
|
|
|
wo_user = config['user']['name']
|
|
|
|
|
wo_email = config['user']['email']
|
2019-07-29 16:27:33 +02:00
|
|
|
except Exception:
|
2019-04-05 10:02:20 +02:00
|
|
|
print("WordOps (wo) require an username & and an email "
|
|
|
|
|
"address to configure Git (used to save server configurations)")
|
|
|
|
|
print("Your informations will ONLY be stored locally")
|
2018-11-13 21:55:59 +01:00
|
|
|
|
|
|
|
|
wo_user = input("Enter your name: ")
|
2019-04-29 00:45:02 +02:00
|
|
|
while wo_user == "":
|
2018-11-13 21:55:59 +01:00
|
|
|
print("Unfortunately, this can't be left blank")
|
|
|
|
|
wo_user = input("Enter your name: ")
|
|
|
|
|
|
|
|
|
|
wo_email = input("Enter your email: ")
|
|
|
|
|
|
|
|
|
|
while not re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$",
|
|
|
|
|
wo_email):
|
2019-04-24 02:01:50 +02:00
|
|
|
print("Whoops, seems like you made a typo - "
|
|
|
|
|
"the e-mailaddress is invalid...")
|
2018-11-13 21:55:59 +01:00
|
|
|
wo_email = input("Enter your email: ")
|
|
|
|
|
|
|
|
|
|
os.system("git config --global user.name {0}".format(wo_user))
|
|
|
|
|
os.system("git config --global user.email {0}".format(wo_email))
|
|
|
|
|
|
|
|
|
|
if not os.path.isfile('/root/.gitconfig'):
|
2019-04-05 10:02:20 +02:00
|
|
|
shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
|
2018-11-13 21:55:59 +01:00
|
|
|
|
|
|
|
|
setup(name='wo',
|
2019-08-28 14:46:47 +02:00
|
|
|
version='3.9.8.5',
|
2018-11-13 21:55:59 +01:00
|
|
|
description=long_description,
|
|
|
|
|
long_description=long_description,
|
|
|
|
|
classifiers=[],
|
|
|
|
|
keywords='',
|
|
|
|
|
author='WordOps',
|
2019-08-05 13:05:56 +02:00
|
|
|
author_email='contact@wordops.io',
|
2019-03-29 12:17:17 +01:00
|
|
|
url='https://wordops.net',
|
2018-11-13 21:55:59 +01:00
|
|
|
license='MIT',
|
|
|
|
|
packages=find_packages(exclude=['ez_setup', 'examples', 'tests',
|
|
|
|
|
'templates']),
|
|
|
|
|
include_package_data=True,
|
|
|
|
|
zip_safe=False,
|
|
|
|
|
test_suite='nose.collector',
|
|
|
|
|
install_requires=[
|
|
|
|
|
# Required to build documentation
|
2019-08-16 13:30:36 +02:00
|
|
|
# "Sphinx >= 1.0",
|
2018-11-13 21:55:59 +01:00
|
|
|
# Required for testing
|
2019-08-16 13:30:36 +02:00
|
|
|
# "nose",
|
|
|
|
|
# "coverage",
|
2018-11-13 21:55:59 +01:00
|
|
|
# Required to function
|
2019-08-08 23:41:28 +02:00
|
|
|
'cement == 2.8.0',
|
2018-11-13 21:55:59 +01:00
|
|
|
'pystache',
|
|
|
|
|
'python-apt',
|
|
|
|
|
'pynginxconfig',
|
2019-08-08 23:41:28 +02:00
|
|
|
'PyMySQL',
|
|
|
|
|
'psutil',
|
2018-11-13 21:55:59 +01:00
|
|
|
'sh',
|
|
|
|
|
'SQLAlchemy',
|
2019-08-08 23:41:28 +02:00
|
|
|
'requests',
|
2019-08-19 12:22:16 +02:00
|
|
|
'distro',
|
2019-04-05 10:02:20 +02:00
|
|
|
],
|
2018-11-13 21:55:59 +01:00
|
|
|
data_files=[('/etc/wo', ['config/wo.conf']),
|
|
|
|
|
('/etc/wo/plugins.d', conf),
|
|
|
|
|
('/usr/lib/wo/templates', templates),
|
|
|
|
|
('/etc/bash_completion.d/',
|
|
|
|
|
['config/bash_completion.d/wo_auto.rc']),
|
|
|
|
|
('/usr/share/man/man8/', ['docs/wo.8'])],
|
|
|
|
|
setup_requires=[],
|
|
|
|
|
entry_points="""
|
|
|
|
|
[console_scripts]
|
|
|
|
|
wo = wo.cli.main:main
|
|
|
|
|
""",
|
|
|
|
|
namespace_packages=[],
|
|
|
|
|
)
|