forked from rvm/rvm-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
40 lines (33 loc) · 880 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
RakeRoot = Pathname.new(Rake.application.find_rakefile_location.last)
require "net/https"
require "nanoc"
require "nanoc/cli"
task :default => :test
desc "Compile & Test"
task :spec => :test
task :test => [:check_ssl, :deploy] do
Dir.chdir(RakeRoot) do
Nanoc::CLI.run(%w(check stale))
Nanoc::CLI.run(%w(check internal_links))
# Nanoc::CLI.run(%w(check external_links))
end
end
desc "Deploy the Site"
task :deploy do
Dir.chdir(RakeRoot) do
Nanoc::CLI.run(%w(compile))
end
end
desc "Check if SSL certificate is valid."
task :check_ssl do
http = Net::HTTP.new("rvm.io", 443)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.use_ssl = true
cert = nil
http.start do |h|
cert = h.peer_cert
end
if (Time.new + 432000) > cert.not_after
abort("There is a imminent problem brewing with SSL, it expires on: #{cert.not_after}")
end
end