diff --git a/config/deploy_hosts.rb b/config/deploy_hosts.rb index e69de2c..ab817ca 100644 --- a/config/deploy_hosts.rb +++ b/config/deploy_hosts.rb @@ -18,6 +18,10 @@ def redis_host def worker_hosts @hash['worker_hosts'] end + + def logstreamer_port + @hash['logstreamer_port'] + end end CONF_FILE = File.expand_path('deploy_hosts.yml', File.dirname(__FILE__)) diff --git a/lib/capistrano/tasks/kochiku.cap b/lib/capistrano/tasks/kochiku.cap index fc9061e..f8b5da8 100644 --- a/lib/capistrano/tasks/kochiku.cap +++ b/lib/capistrano/tasks/kochiku.cap @@ -22,6 +22,7 @@ namespace :kochiku do kochiku_web_server_protocol: #{HostSettings.kochiku_web_protocol} build_strategy: build_all redis_host: #{HostSettings.redis_host} + logstreamer_port: #{HostSettings.logstreamer_port} END upload! StringIO.new(config), release_path.join("config/kochiku-worker.yml") end diff --git a/lib/capistrano/tasks/logstreamer.cap b/lib/capistrano/tasks/logstreamer.cap new file mode 100644 index 0000000..0d4bf90 --- /dev/null +++ b/lib/capistrano/tasks/logstreamer.cap @@ -0,0 +1,18 @@ +namespace :deploy do + + desc 'Build Log Streamer Go files' + task :build_log_streamer do + on roles(:all) do + commands = [ + "cd #{release_path}/logstreamer", + "export GOPATH=$(pwd)", + "go get github.com/julienschmidt/httprouter", + "go get github.com/stretchr/testify/assert", + "make" + ] + execute commands.join(' && ') + end + end + + before :publishing, :build_log_streamer +end