forked from korczis/gooddata-ruby-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (37 loc) · 1.04 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
# encoding: UTF-8
# require 'rake/notes/rake_task'
# require 'rspec/core/rake_task'
desc 'Build book'
task :build do
system 'cd lib && rake build'
end
desc 'Run continuous integration'
task :ci do
system 'cd lib && rake ci'
end
desc 'Run all tests'
task :test => 'test:all'
task :usage do
puts 'No rake task specified, use rake -T to list them'
end
# deploy task is in the root, because we need to push stuff to gh-pages branch
# where the lib directory doesn't exist
desc 'Deploy the book to the web'
task :deploy do
last_commit = `git log -n 1`.split("\n")[0].split(' ')[1] rescue 'unknown'
# build the book
Rake::Task['build'].invoke
# checkout the gh-pages branch
system('git checkout gh-pages') or fail "Checkout failed"
# make it an index and push it there
`mv book.html index.html
git add index.html
git commit -m "new cookbook version from master #{last_commit}"
git push origin gh-pages
git checkout master`
end
desc 'Clean generated files'
task :clean do
system 'git clean -f'
end
task :default => [:usage]