forked from robotframework/robotframework.github.com
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (35 loc) · 993 Bytes
/
Rakefile
File metadata and controls
39 lines (35 loc) · 993 Bytes
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
require "tmpdir"
desc "Builds the project, expects the command `jekyll` to be available."
task :build do
system "jekyll"
end
desc "Helper task to check if everything is committed."
task :commited? do
output = `git status`
unless /nothing to commit/. =~ output
system "git commit -a"
end
end
desc "Deploys the project to master branch, expects the command `git` to be available."
task :deploy => [:build, :commited?] do
Dir.mktmpdir do |tempdir|
puts "Copying generated site: _site/* -> #{tempdir}"
FileUtils.cp_r "_site/.", tempdir
unless system "git checkout master"
fail
end
puts "Copying generated site: #{tempdir}/* -> ./"
FileUtils.cp_r "#{tempdir}/.", "./"
system "git add ."
unless system "git commit"
fail
end
system "git push origin master"
system "git checkout source"
puts "DONE!"
end
end
desc "Shows help text."
task :default do
puts "Run `rake --tasks` or `rake -T` to see available commands\n"
end