From c3381676099533142acea4191070ec3b889abbab Mon Sep 17 00:00:00 2001 From: Alex Rothenberg Date: Fri, 20 May 2016 15:53:04 -0400 Subject: [PATCH 1/2] Cap deploy can set the log streamer port in kochiku config --- config/deploy_hosts.rb | 4 ++++ lib/capistrano/tasks/kochiku.cap | 1 + 2 files changed, 5 insertions(+) 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 From 575a6e8a39f8012fd6685d0c932167cc8aef1678 Mon Sep 17 00:00:00 2001 From: Alex Rothenberg Date: Thu, 19 May 2016 12:01:35 -0400 Subject: [PATCH 2/2] build the log streamer on deploy --- lib/capistrano/tasks/logstreamer.cap | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/capistrano/tasks/logstreamer.cap 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