-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (31 loc) · 935 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
require 'rake'
task :run do
pids = [
spawn('cd rails && rails s'),
spawn('cd ember && ./node_modules/.bin/ember server --proxy http://localhost:3000'),
]
trap 'INT' do
Process.kill 'INT', *pids
exit 1
end
loop do
sleep 1
end
end
task :deploy do
sh 'git checkout production'
sh 'git merge master -m "Merging master for deployment"'
sh 'cd ember && ./node_modules/.bin/ember build --environment=production --output-path=../rails/public/ && cd ..'
unless `git status` =~ /nothing to commit, working directory clean/
sh 'git add -A'
sh 'git commit -m "Asset compilation for deployment"'
end
sh 'git subtree push -P rails heroku master'
release_output = `heroku releases -a goatspace`.split "\n"
latest_release = release_output[1].match(/v\d+/).to_s
tags = `git tag`
unless tags.include? latest_release
sh "git tag #{latest_release}"
end
sh 'git checkout -'
end