View default
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/home/anoob.bava/blog_app/shared/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
View deploy_to_check_master.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# Usually mina focuses on deploying to one host and the deploy options are therefore simple.
# In our case, there is a number of possible servers to deploy to, it is therefore necessary to
# specify the host that we are targeting.
server = ENV['server']
# Since the same host can have multiple applications running in parallel, it is necessary to
View deploy.rb
require 'mina/git'
require 'mina/bundler'
require 'mina/rails'
require 'mina/unicorn'
require 'mina/rvm'
# preset defaults
set :application_name, 'blog_app'
set :domain, '35.231.73.143'
set :deploy_to, '/home/anoob.bava/blog_app'
View deploy_skeleton.rb
# added all the dependencies
#ex: require "this" or "that" etc
# preset defaults
set :application_name, 'your application name, say like a repo name'
set :domain, 'ip address of the server or domain name'
set :deploy_to, 'to where the app to be installed'
set :repository, 'repo link'
set :branch, 'branch may be staging, qa,production etc'
set :user, 'to which user is deploying the app'
View unicorn.rb
# encoding: utf-8
# Set your full path to application.
app_dir = File.expand_path('../../', __FILE__)
shared_dir = File.expand_path('../../../shared/', __FILE__)
# Set unicorn options
worker_processes 2
preload_app true
timeout 30
View nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
View deploy.rb
# Mina Deploy
# ===========
#
# Adapted from Creative deploy stack in Manabalss v4, Mar.2015, updated to support staging on Jun.2015
# On first deploy do: mina setup --verbose
# Then do : mina deploy[initialize] --trace
#
# Usage examples:
# mina deploy[soft,seed,compile] to=staging # deploy task with all options | a simple `mina deploy` will deploy to production
# mina rake[db:seed] # for multi-argument tasks # mina 'rake[payments:refund[arg1\,arg2]]'
View mina
# config/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# ter_mode 这个要设置,不然在 mac 下输密码有问题
set :term_mode, nil
set :rvm_path, '/usr/local/rvm/bin/rvm'
View deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, 'deploy@host'
set :repository, 'git...
set :branch, 'master'
set :shared_paths, ['config/database.yml', 'config/application.yml', 'log', 'tmp/sockets', 'tmp/pids']
View users_controller.rb
class UsersController < ApplicationController
def new
@user = UserInformation.new
end
def index
@users = UserInformation.all
end