Spree Deployment Service

http://spreecasts.org/03-deploy-spree-shop-to-vps-with-deployment-s

# on mac, preparation
brew install mysql
brew info mysql
# follow the prompt to set root user and start mysql

rails new spree-shop -d mysql
cd spree-shop
vim config/database.yml
# update database password
bundle
bundle exec rake db:create
bundle exec rake db:create:all
spree install --edge

# go to spree website and add deployment
# once deployment is set up, update Gemfile

# on local
bundle
bundle exec capify .

# on remote run the initialization configuration script from spree, and wait

# on remote
cd /home/spree
mkdir .ssh
vim .ssh/authorized_keys
# paste your local id_rsa.pub into authorized_keys
chown spree:spree .ssh
chmod 700 .ssh
chmod 600 .ssh/authorized_keys

# replace the content of config/deploy.rb with capistrano recipe from spree

# on local
git add .
git commit -am "capified"
git push

# on local
bundle exec cap deploy:check
bundle exec cap deploy:cold

# shop is up now, but no ssl
# on local
vim config/initializers/spree.rb
# in the Spree.config, add:
config.allow_ssl_in_production = false
bundle exec cap deploy

# now you can visit admin without ssl
# however admin user is not present on remote
# on remote
cd /data/spree/current
rake db:seed RAILS_ENV=production

Leave a Reply