[deploy] config
This commit is contained in:
7
config.shmyga.ru.json
Normal file
7
config.shmyga.ru.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"SdkDir": "/home/holop/sdk",
|
||||
"SSH": {
|
||||
"PrivateKey": null,
|
||||
"Passphrase": null
|
||||
}
|
||||
}
|
||||
16
config/config.rb
Normal file
16
config/config.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
set :config_role, :app
|
||||
set :config_path, -> { release_path }
|
||||
set :config_type, 'json'
|
||||
|
||||
|
||||
namespace :config do
|
||||
task :setup do
|
||||
config_role = fetch(:config_role)
|
||||
config_path = fetch(:config_path)
|
||||
config_type = fetch(:config_type)
|
||||
on roles(config_role) do |server|
|
||||
# stage = fetch(:stage)
|
||||
execute "cd #{config_path} && cp config.#{server.hostname}.#{config_type} config.#{config_type}"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,5 @@
|
||||
require_relative 'npm'
|
||||
require_relative 'config'
|
||||
|
||||
app = 'tankz'
|
||||
user = 'holop'
|
||||
@@ -13,6 +14,9 @@ set :deploy_to, "/home/#{user}/repo/#{app}"
|
||||
set :format, :airbrussh
|
||||
set :format_options, command_output: false
|
||||
|
||||
# config
|
||||
before 'deploy:updated', 'config:setup'
|
||||
|
||||
# npm
|
||||
set :npm_target_path, -> { "/home/#{fetch(:user)}/npm" }
|
||||
set :npm_flags, '--silent --no-spin'
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
role :app, %w{94.130.110.9}
|
||||
role :web, %w{94.130.110.9}
|
||||
role :db, %w{94.130.110.9}
|
||||
# host = '94.130.110.9'
|
||||
host = 'shmyga.ru'
|
||||
|
||||
role :app, host
|
||||
role :web, host
|
||||
role :db, host
|
||||
|
||||
user = fetch(:user)
|
||||
|
||||
server '94.130.110.9', ssh_options: { port: 22, user: user, forward_agent: true }
|
||||
server host, ssh_options: { port: 22, user: user, forward_agent: true }
|
||||
|
||||
set :tmp_dir, "/home/#{user}/tmp"
|
||||
set :branch, 'master'
|
||||
|
||||
Reference in New Issue
Block a user