diff --git a/Capfile b/Capfile index 38a2d8e1..f68230b6 100644 --- a/Capfile +++ b/Capfile @@ -10,7 +10,7 @@ install_plugin Capistrano::Puma # Default puma tasks require 'capistrano/puma/workers' require 'capistrano/puma/jungle' require 'capistrano/bundler' -# require 'capistrano/nginx' +require 'capistrano/nginx' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'capistrano/postgresql' diff --git a/config/deploy.rb b/config/deploy.rb index 8492c114..af864119 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,5 +1,5 @@ set :application, "thirteen_tien_len_#{fetch(:stage)}" -set :repo_url, 'git@git.chefzeppelin.com:jesse/thirteen-tien-len.git' +set :repo_url, 'git@pineapple.punked.us:Bort/thirteen-tien-len.git' # If you want to import assets, you can change default asset dir (default = system) # This directory must be in your shared directory on the server @@ -9,7 +9,8 @@ set :assets_dir, %w(public/assets public/system) #set :branch, proc { `git rev-parse --abbrev-ref stash`.chomp } #ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } -set :deploy_to, "/home/jesse/srv/thirteen-tien-len_#{fetch(:stage)}" +set :remote_user, "thirteen" +set :deploy_to, "/home/thirteen/srv/thirteen-tien-len_#{fetch(:stage)}" # set :scm, :git # set :format, :pretty @@ -18,14 +19,14 @@ set :deploy_to, "/home/jesse/srv/thirteen-tien-len_#{fetch(:stage)}" # set :linked_files, %w{config/database.yml .env} -append :linked_files, "puma.rb" +# append :linked_files, "puma.rb" # append :linked_files, "config/master.key" append :linked_files, "config/database.yml" append :linked_files, ".env" set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/lift-calculator} -set :rbenv_type, :system # or :system, depends on your rbenv setup +set :rbenv_type, :system # or :user , depends on your rbenv setup # set :rbenv_ruby, '2.6.0' set :rbenv_ruby, File.read('.ruby-version').strip set :rbenv_map_bins, %w{rake gem bundle ruby rails} @@ -39,10 +40,12 @@ set :default_env, { # set :keep_releases, 5 +# global rbenv install config set :rbenv_custom_path, "/usr/local/rbenv" set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_custom_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_custom_path)}/bin/rbenv exec" -# set :nginx_path, '/etc/nginx' # directory containing sites-available and sites-enabled -# set :nginx_template, 'config/deploy/nginx_conf.erb' # configuration template + +set :nginx_path, '/etc/nginx' # directory containing sites-available and sites-enabled +set :nginx_template, 'config/deploy/nginx_conf.erb' # configuration template #set :nginx_server_name, 'example.com' # optional, defaults to :application #set :nginx_upstream, 'example-app' # optional, defaults to :application # set :nginx_listen, 80 # optional, default is not set diff --git a/config/deploy/nginx_conf.erb b/config/deploy/nginx_conf.erb index cb1d3d1a..6770631a 100644 --- a/config/deploy/nginx_conf.erb +++ b/config/deploy/nginx_conf.erb @@ -1,5 +1,5 @@ upstream <%= fetch(:nginx_upstream) %> { - server unix:///home/jesse/web/thirteen-tien-len_<%= fetch(:stage) %>/shared/tmp/sockets/puma.sock fail_timeout=0; + server unix:///home/<%= fetch(:remote_user) %>/srv/thirteen-tien-len_<%= fetch(:stage) %>/shared/tmp/sockets/puma.sock fail_timeout=0; } server { diff --git a/config/deploy/production.rb b/config/deploy/production.rb index c76b5e4b..b1da36cb 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -6,10 +6,10 @@ set :nginx_server_name, '13.24x7.hk' # optional, defaults to :application # ================== # server in each group is considered to be the first # unless any hosts have the primary property set. -role :app, %w{jesse@13.24x7.hk} +role :app, %w{thirteen@13.24x7.hk} # Supports bulk-adding hosts to roles, the primary -role :web, %w{jesse@13.24x7.hk} -role :db, %w{jesse@13.24x7.hk} +role :web, %w{thirteen@13.24x7.hk} +role :db, %w{thirteen@13.24x7.hk} # Extended Server Syntax # ====================== @@ -17,18 +17,19 @@ role :db, %w{jesse@13.24x7.hk} # definition into the server list. The second argument # something that quacks like a hash can be used to set # extended properties on the server. -server '13.24x7.hk', user: 'jesse', roles: %w{web app db}, my_property: :my_value +server '13.24x7.hk', user: 'thirteen', roles: %w{web app db}, my_property: :my_value + +set :ssh_options, { :verbose => :debug } + + # you can set custom ssh options # it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options # you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start) # set it globally - set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# port: 27997 - } + set :ssh_options, { keys: %w(/home/bort/.ssh/id_ed25519), forward_agent: true, auth_methods: %w(publickey)} +# you can set custom ssh options +# it's possible to pass # and/or per server # server 'example.com', # user: 'user_name', diff --git a/config/secrets.yml b/config/secrets.yml index 8f82c2d3..8f89c3b3 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -12,7 +12,7 @@ development: admin_name: Wizard of Hearts - admin_email: jesse@chefzeppelin.com + admin_email: bort@pineapple.punked.us admin_password: changeme admin_soft_token: SeedToken email_provider_username: <%= ENV["GMAIL_USERNAME"] %>