Exemple #1
0
    def __init__(self, release_path):
        super(GunicornDeploy, self).__init__()
        self.release_path = release_path
        self.nginx = NginxDeploy()

        required_envs([
            'project_name',
            'gunicorn_port'
        ])
Exemple #2
0
class GunicornDeploy(object):
    def __init__(self, release_path):
        super(GunicornDeploy, self).__init__()
        self.release_path = release_path
        self.nginx = NginxDeploy()

        required_envs(['project_name', 'gunicorn_port'])

    def deploy(self, config_file=None):
        if not files.exists('/etc/init.d/gunicorn'):
            puts('gunicorn init script not found, running setup',
                 m_type='warn')
            self.setup()

        puts('transferring gunicorn configurarion and restart')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0],
                                       'gunicorn_project.conf')

        files.upload_template(filename=config_file,
                              destination="/etc/gunicorn.d/%s" %
                              env.project_name,
                              context=env,
                              backup=False,
                              use_sudo=True)
        restart_service('gunicorn')
        self.nginx.setup_site()

    def setup(self):
        puts('Installing Gunicorn')
        install_packages([
            'gunicorn=0.13.4-1',
        ])

    def status(self):
        http_status(host=env.host_string,
                    port=env.gunicorn_port,
                    name='Gunicorn')
        self.nginx.status()
Exemple #3
0
class GunicornDeploy(object):

    def __init__(self, release_path):
        super(GunicornDeploy, self).__init__()
        self.release_path = release_path
        self.nginx = NginxDeploy()

        required_envs([
            'project_name',
            'gunicorn_port'
        ])

    def deploy(self, config_file=None):
        if not files.exists('/etc/init.d/gunicorn'):
            puts('gunicorn init script not found, running setup', m_type='warn')
            self.setup()

        puts('transferring gunicorn configurarion and restart')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0], 'gunicorn_project.conf')

        files.upload_template(filename=config_file,
                              destination="/etc/gunicorn.d/%s" % env.project_name,
                              context=env,
                              backup=False,
                              use_sudo=True)
        restart_service('gunicorn')
        self.nginx.setup_site()

    def setup(self):
        puts('Installing Gunicorn')
        install_packages([
            'gunicorn=0.13.4-1',
        ])

    def status(self):
        http_status(host=env.host_string, port=env.gunicorn_port,  name='Gunicorn')
        self.nginx.status()
Exemple #4
0
class GunicornDeploy(object):

    def __init__(self, release_path):
        super(GunicornDeploy, self).__init__()
        self.release_path = release_path
        self.nginx = NginxDeploy()

        required_envs([
            'project_name',
            'gunicorn_port'
        ])

    def deploy(self, config_file=None):
        puts('transferring gunicorn configurarion and restart')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0], 'gunicorn_django_site')

        files.upload_template(filename=config_file,
                              destination="/etc/default/gunicorn_django-%s" % env.project_name,
                              context=env,
                              use_sudo=True)
        sudo('/etc/init.d/gunicorn_django restart %s' % env.project_name, pty=False)
        self.nginx.setup_site()

    def setup(self, config_file=None):
        puts('Add Gunicorn init script')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0], 'gunicorn_django_server')
        files.upload_template(filename=config_file,
                              destination="/etc/init.d/gunicorn_django",
                              use_sudo=True)
        sudo('chmod +x /etc/init.d/gunicorn_django')
        self.nginx.setup_server()

    def status(self):
        http_status(host=env.host_string, port=env.gunicorn_port,  name='Gunicorn')
        self.nginx.status()
Exemple #5
0
    def __init__(self, release_path):
        super(GunicornDeploy, self).__init__()
        self.release_path = release_path
        self.nginx = NginxDeploy()

        required_envs(['project_name', 'gunicorn_port'])