Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a Pyramid app using pserve without installation?

I'm a beginner for Pyramid.

I want to deploy Pyramid to my production server. I have a deploy script using Capistrano to do this.

set :pid_path, "/var/lib/#{application}"
set :log_path, "/var/log/#{application}"

namespace :deploy do

    task :restart, :roles => :app do
    end

    task :finalize_update, :roles => :app do
        run "cd #{release_path} && python setup.py build"
        %w[ 5000 5001 ].each do |port|
            run "if [ -f #{pid_path}/#{port}.pid ]; then paster serve --stop-daemon --pid-file=#{pid_path}/#{port}.pid; fi"
            run "paster serve --daemon --pid-file=#{pid_path}/#{port}.pid --log-file=#{log_path}/paster.log #{release_path}/production.ini http_port=#{port}"
        end
    end

end

But it does not work without installation typing 'sudo python setup.py install'. If I write code to do this, it might work but I don't want to do it because of permissions.

Does someone have any suggestions?

like image 292
Takahiro Fujiwara Avatar asked Feb 28 '12 08:02

Takahiro Fujiwara


1 Answers

Okay, your best bet is to set up a virtualenv , activate it and then install the application in that virtualenv and run it from there :-)

Besides that there are options of using the setuptools/distutils to install into your local user folder by using the --user argument to easy_install as noted here: http://docs.python.org/install/index.html

But seriously, use virtualenv :-)

like image 114
supakeen Avatar answered Oct 23 '22 11:10

supakeen