Replacing Heroku
heroku login
heroku create
git push heroku master
A service for deploying applications
"Nothing sweeter than git push production master"
gem install rails && rbenv rehash
rails new jokes && cd jokes
bundle exec rails generate scaffold Joke joke:string punchline:string
bundle exec rake db:migrate
Rails.application.routes.draw do
resources :jokes
root to: 'jokes#index'
end
gem 'therubyracer', platforms: :ruby
apt-get update
apt-get install git-core curl zlib1g-dev build-essential libssl-dev
libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev
libcurl4-openssl-dev python-software-properties libffi-dev
useradd -m app
chsh app -s /bin/bash
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 2.3.0
rbenv global 2.3.0
gem install bundler
group :production do
gem 'puma'
end
wget https://raw.githubusercontent.com/puma/puma/master/tools/jungle/upstart/puma-manager.conf
wget https://raw.githubusercontent.com/puma/puma/master/tools/jungle/upstart/puma.conf
setuid app
setgid app
export SECRET_KEY_BASE="YOUR_SECRET_KEY_HERE"
sudo cp puma.conf puma-manager.conf /etc/init
/home/app/jokes
apt-get install nginx
sudo su - app && cd
mkdir ~/jokes-production && cd ~/jokes-production
git init --bare
sudo sh -c 'echo "app ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-app'
git remote add production app@rails.atomaka.com:jokes-production
git push production master