lib/mascherano/tasks/go.cap in mascherano-1.1.0 vs lib/mascherano/tasks/go.cap in mascherano-1.2.0
- old
+ new
@@ -2,19 +2,20 @@
desc <<-DESC
Compile the go application locally
You can override any of these defaults by setting the variables shown below.
- set :go_input, 'api.go'
- set :go_output, 'api'
- set :go_os, 'linux'
- set :go_arch, 'amd64'
- set :go_roles, :app
- set :go_target, -> { release_path.join(fetch(:go_output)) }
+ set :go_input, 'api.go'
+ set :go_output, 'api'
+ set :go_os, 'linux'
+ set :go_arch, 'amd64'
+ set :go_roles, :app
+ set :go_servers, -> { release_roles(fetch(:go_roles)) }
+ set :go_target, -> { release_path.join(fetch(:go_output)) }
DESC
task :build do
- on roles(fetch(:go_roles)) do
+ on fetch(:go_servers) do
run_locally do
go_flags = {
'GOOS' => fetch(:go_os),
'GOARCH' => fetch(:go_arch)
}
@@ -26,21 +27,22 @@
end
end
desc 'Upload compiled application to the server'
task :upload do
- on roles(fetch(:go_roles)) do
+ on fetch(:go_servers) do
upload! fetch(:go_output), fetch(:go_target)
end
end
end
namespace :load do
task :defaults do
- set :go_input, 'api.go'
- set :go_output, 'api'
- set :go_os, 'linux'
- set :go_arch, 'amd64'
- set :go_roles, :app
- set :go_target, -> { release_path.join(fetch(:go_output)) }
+ set :go_input, 'api.go'
+ set :go_output, 'api'
+ set :go_os, 'linux'
+ set :go_arch, 'amd64'
+ set :go_roles, :app
+ set :go_servers, -> { release_roles(fetch(:go_roles)) }
+ set :go_target, -> { release_path.join(fetch(:go_output)) }
end
end