-
Notifications
You must be signed in to change notification settings - Fork 114
/
Rakefile
38 lines (32 loc) · 1.17 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
require_relative "helpers/constants"
desc "Build site"
task :build do
sh "bundle exec middleman build"
end
desc "Run development server"
task :server do
sh "bundle exec middleman server"
end
task rsync: :"rsync:production"
namespace :rsync do
desc "Upload documentation to staging server"
task staging: [:build] do
sh "cd build && rsync -rv --progress --partial-dir=.rsync-partial --human-readable . " +
"[email protected]:/var/www/docs_2018/"
end
desc "Upload documentation to production server"
task production: [:build] do
sh "cd build && rsync -rv --progress --partial-dir=.rsync-partial --human-readable . " +
"[email protected]:/var/www/docs_2018/"
end
end
desc "Check broken links"
task :checklinks do
# Ignore everything besides http://127.0.0.1:4567
non_main_domain_regex = '^(?!http:\/\/127\.0\.0\.1:4567(\/|$))'
# Ignore LiveReload stuff
livereload_regex = '^http:\/\/127\.0\.0\.1:4567\/__rack'
sh "linkchecker http://127.0.0.1:4567/sub/index.html" +
" --ignore-url #{Shellwords.escape non_main_domain_regex}" +
" --ignore-url #{Shellwords.escape livereload_regex}"
end