Exemplo n.º 1
0
    def setup_site(self, config_file=None):
        puts('adding HTTP Server config files for project')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0], 'nginx_site.conf')

        sudo("rm -f /etc/nginx/sites-enabled/%s" % env.project_name)

        files.upload_template(filename=config_file,
                              destination="/etc/nginx/sites-enabled/%s.conf" % env.project_name,
                              context=env,
                              use_sudo=True)
        restart_service('nginx')
Exemplo n.º 2
0
 def setup_server(self, config_file=None):
     puts('installing NGINX')
     if not config_file:
         config_file = os.path.join(scripts.__path__[0], 'nginx_server.conf')
     install_packages([
         'nginx',
     ])
     puts('adding base HTTP Server config files')
     files.upload_template(filename=config_file,
                           destination="/etc/nginx/nginx.conf",
                           use_sudo=True)
     restart_service('nginx')
Exemplo n.º 3
0
    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()
Exemplo n.º 4
0
    def setup_site(self, config_file=None):
        if not files.exists('/etc/init.d/nginx'):
            puts('nginx not found, running setup', m_type='warn')
            self.setup_server()


        puts('adding HTTP Server config files for project')
        if not config_file:
            config_file = os.path.join(scripts.__path__[0], 'nginx_site.conf')

        sudo("rm -f /etc/nginx/sites-enabled/%s" % env.project_name)

        files.upload_template(filename=config_file,
                              destination="/etc/nginx/sites-enabled/%s.conf" % env.project_name,
                              context=env,
                              use_sudo=True)
        restart_service('nginx')
Exemplo n.º 5
0
    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()