Beispiel #1
0
 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()
Beispiel #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)
Beispiel #3
0
 def setup(self):
     puts("setup new project")
     server_upgrade()
     self.install_pil()
     install_packages(
         self.extra_packages +
         [
             'git-core',
             'curl',
         ]
     )
Beispiel #4
0
    def deploy(self):
        if not files.exists('/usr/bin/git'):
            puts('new fresh server :D', m_type='warn')
            self.setup()

        puts("deploying your project")
        self.create_folder()
        self.create_python_enviroment()
        self.upload()
        self.install_pip_dependancies()
        self.django.deploy()
Beispiel #5
0
    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()
Beispiel #6
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')
Beispiel #7
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()
Beispiel #8
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')
Beispiel #9
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()
Beispiel #10
0
 def collect_static(self):
     puts("Collecting static files")
     run('{0}/bin/python {1}/manage.py collectstatic --noinput'.format(env.remote_virtualenv_path,
                                                                       env.remote_current_path))
Beispiel #11
0
 def deploy(self):
     puts("Deploying Project...")
     self.collect_static()
     self.gunicorn.deploy()
Beispiel #12
0
 def setup(self):
     puts("setup new project...")
     server_upgrade()
     install_packages(["git-core"])
     self.django.setup()
     self.deploy()
Beispiel #13
0
 def setup(self):
     puts('Installing Gunicorn')
     install_packages([
         'gunicorn=0.13.4-1',
     ])
Beispiel #14
0
 def setup(self):
     puts('Installing Gunicorn')
     install_packages([
         'gunicorn=0.13.4-1',
     ])
Beispiel #15
0
 def collect_static(self):
     puts("Collecting static files")
     run('{0}/bin/python {1}/manage.py collectstatic --noinput'.format(env.remote_virtualenv_path,
                                                                       env.remote_current_path))
Beispiel #16
0
 def deploy(self):
     puts("running django deploy")
     self.collect_static()
     self.gunicorn.deploy()