-
Notifications
You must be signed in to change notification settings - Fork 18
/
Rakefile
50 lines (43 loc) · 1.13 KB
/
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
46
47
48
49
50
APPNAME = 'ember-skeleton'
require 'colored'
require 'rake-pipeline'
desc "Build #{APPNAME}"
task :build do
Rake::Pipeline::Project.new('Assetfile').invoke
end
desc "Deploy #{APPNAME} to gh-pages branch"
task :deploy do
`rm -rf build`
`mkdir build`
origin = `git config remote.origin.url`.chomp
ENV["RAKEP_MODE"] = "production"
Rake::Task["build"].invoke
Dir.chdir "build" do
`git init`
`git remote add origin #{origin}`
`git checkout -b gh-pages`
`cp ../index.html .`
`cp -r ../assets .`
`rm assets/app-tests.js`
`git add .`
`git commit -m 'Site updated at #{Time.now.utc}'`
`git push -f origin gh-pages`
end
`rm -rf build`
end
desc "Run tests with PhantomJS"
task :test => :build do
unless system("which phantomjs > /dev/null 2>&1")
abort "PhantomJS is not installed. Download from http://phantomjs.org/"
end
cmd = "phantomjs tests/qunit/run-qunit.js \"file://#{File.dirname(__FILE__)}/tests/index.html\""
# Run the tests
puts "Running #{APPNAME} tests"
success = system(cmd)
if success
puts "Tests Passed".green
else
puts "Tests Failed".red
exit(1)
end
end