-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile-drake
68 lines (60 loc) · 1.5 KB
/
Rakefile-drake
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def git(*args)
sh "git", *args
end
task :drake_pull_mainline do
git "pull",
"--no-commit",
"git://github.com/jimweirich/rake.git",
"refs/heads/master:refs/heads/origin"
end
task :drake_check_directory do
unless `git status` =~ %r!nothing to commit \(working directory clean\)!
raise "Directory not clean"
end
end
task :drake_prerelease => [:clobber, :gemspec, :drake_check_directory] do
unless `git pull` =~ %r!Already up-to-date!
raise "New stuff from remote repository"
end
%w[github.com].each { |server|
cmd = "ping " + (
if Config::CONFIG["host"] =~ %r!darwin!
"-c2 #{server}"
else
"#{server} 2 2"
end
)
unless `#{cmd}` =~ %r!0% packet loss!
raise "No ping for #{server}"
end
}
end
task :drake_publish => :rdoc do
Dir.chdir("html") {
sh "scp", "-r", ".", "[email protected]:/var/www/gforge-projects/drake"
}
git "branch", "-D", "gh-pages"
git "checkout", "--orphan", "gh-pages"
FileUtils.rm ".git/index"
git "clean", "-fdx", "-e", "html"
Dir["html/*"].each { |path|
FileUtils.mv path, "."
}
FileUtils.rmdir "html"
git "add", "."
git "commit", "-m", "generated by rdoc"
git "push", "-f", "origin", "gh-pages"
end
task :drake_finish_release do
gem = "#{SPEC.name}-#{SPEC.version}.gem"
git "tag", "drake-#{SPEC.version}"
git "push", "--tags", "origin", "master"
sh "gem", "push", gem
end
task :drake_release =>
[
:drake_prerelease,
:gem,
:test,
:drake_finish_release,
]