Commit da9fe189 by Tan Phat Nguyen

Add bin folder

parent 48cb5764
#!/usr/bin/env ruby.exe #!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle') load Gem.bin_path('bundler', 'bundle')
#!/usr/bin/env ruby.exe #!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot' require_relative '../config/boot'
require 'rails/commands' require 'rails/commands'
#!/usr/bin/env ruby.exe #!/usr/bin/env ruby
require_relative '../config/boot' require_relative '../config/boot'
require 'rake' require 'rake'
Rake.application.run Rake.application.run
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
lock '3.2.1' lock '3.2.1'
set :application, 'venshop' set :application, 'venshop'
set :repo_url, 'git@gitlab.zigexn.vn:phatnt/venshop.git' # set :repo_url, 'git@gitlab.zigexn.vn:phatnt/venshop.git'
set :repo_url, 'git@bitbucket.org:ntphat/demo.git'
set :branch, 'release' set :branch, 'release'
# Default branch is :master # Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
# Default deploy_to directory is /var/www/my_app # Default deploy_to directory is /var/www/my_app
set :deploy_to, '/web/training/phatnt' # set :deploy_to, '/web/training/phatnt'
set :deploy_to, '/home/deployer/phatnt'
# Default value for :scm is :git # Default value for :scm is :git
# set :scm, :git # set :scm, :git
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
# is considered to be the first unless any hosts have the primary # is considered to be the first unless any hosts have the primary
# property set. Don't declare `role :all`, it's a meta role. # property set. Don't declare `role :all`, it's a meta role.
role :app, %w{192.168.1.204} # role :app, %w{192.168.1.204}
role :app, %w{128.199.154.62}
# role :web, %w{deploy@example.com} # role :web, %w{deploy@example.com}
# role :db, %w{deploy@example.com} # role :db, %w{deploy@example.com}
...@@ -32,7 +33,8 @@ role :app, %w{192.168.1.204} ...@@ -32,7 +33,8 @@ role :app, %w{192.168.1.204}
# } # }
# #
set :ssh_options, { set :ssh_options, {
user: 'ventura' # user: 'ventura'
user: 'deployer'
} }
# And/or per server (overrides global) # And/or per server (overrides global)
......
app_path = '/web/training/phatnt' app_path = '/home/deployer/phatnt'
working_directory "#{app_path}/current" working_directory "#{app_path}/current"
pid "#{app_path}/current/tmp/pids/unicorn.pid" pid "#{app_path}/current/tmp/pids/unicorn.pid"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment