3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/foundry_wordpress_tool/git.rb', line 3
def self.included(thor)
thor.class_eval do
desc "remote_git_pull", "Pull latest code on the remote server via git"
def remote_git_pull
load_environment_config()
cap_run("cd #{@config['deploy_to']} && git pull").run_command
end
no_tasks do
def cap_run(command)
cap = Capistrano::Configuration.new
cap.logger.level = Capistrano::Logger::TRACE
cap.set :user, @config['username']
cap.role :app, @config['host']
cap.task :run_command do
run command
end
cap
end
end
end
end
|