forked from nu7hatch/egoistat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (35 loc) · 921 Bytes
/
Rakefile
1
2
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- ruby -*-
begin
require 'bundler/setup'
rescue LoadError
$stderr.write("ERROR: Bundler not installed, run `gem install bundler` to get it.\n")
end
require 'rosey/tasks/all'
$GO = ENV['GO'] || "go"
$FOREMAN = ENV['FOREMAN'] || "foreman"
$PUBLIC_DIR ||= "public"
$COMPILED_ASSETS_DIR ||= "#{$PUBLIC_DIR}/assets"
$PRODUCTION_BRANCH ||= "production"
task :default => ["build", "assets:precompile"]
desc "Starts application server."
task :server => :install do
sh "#{$FOREMAN} start"
end
desc "Installs backend application so it can be used by the server."
task :install => :build do
sh "#{$GO} install ."
end
desc "Rebuilds backend application."
task :build do
sh "#{$GO} build ."
end
desc "Runs all tests against backend."
task :test do
sh "#{$GO} test ./..."
end
namespace :deploy do
task :push do
sh "#{$GIT} push heroku #{$PRODUCTION_BRANCH}:master"
end
task :prepare => :default
end