forked from travis-ci/docs-travis-ci-com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
49 lines (41 loc) · 1.38 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
#!/usr/bin/env rake
require 'html/proofer'
task :default => [:test]
desc 'Runs the tests!'
task :test => :build do
Rake::Task['run_html_proofer'].invoke
end
desc 'Builds the site'
task :build => :remove_output_dir do
FileUtils.rm '.jekyll-metadata' if File.exist?('.jekyll-metadata')
sh 'bundle exec jekyll build --config=_config.yml'
end
desc 'Remove the output dir'
task :remove_output_dir do
FileUtils.rm_r('_site') if File.exist?('_site')
end
desc 'Runs the html-proofer test'
task :run_html_proofer do
# seems like the build does not render `%3*`,
# so let's remove them for the check
href_swap = {
/%3A\z/ => '',
/%3F\z/ => '',
/-\.travis\.yml/ => '-travisyml'
}
tester = HTML::Proofer.new('./_site', {
:href_swap => href_swap,
:connecttimeout => 600,
:only_4xx => true,
:typhoeus => { :ssl_verifypeer => false, :ssl_verifyhost => 0, :followlocation => true },
:url_ignore => ["https://www.appfog.com/",
/coverity.com/],
:file_ignore => ["./_site/api/index.html", "./_site/user/languages/erlang/index.html"]
})
tester.run
end
namespace :assets do
task :precompile do
puts `bundle exec jekyll build`
end
end