forked from OSC/ood-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (30 loc) · 924 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
# task default: %w[build]
task :default do
system "rake --tasks"
end
namespace :pipenv do
desc "Build docs using pipenv"
task :build do
exec 'WORKDIR=/doc PIPENV_VENV_IN_PROJECT=1 pipenv run make html'
end
task :clean do
exec 'WORKDIR=/doc PIPENV_VENV_IN_PROJECT=1 pipenv run make clean'
end
desc "Install pipenv dependencies"
task :install do
exec 'WORKDIR=/doc PIPENV_VENV_IN_PROJECT=1 pipenv install'
end
end
namespace :docker do
desc "Build docs using docker"
task :build do
exec 'docker run --rm -i -t -v "${PWD}:/doc" -u "$(id -u):$(id -g)" ohiosupercomputer/docker-sphinx make html'
end
end
desc "Open built documentation in browser"
task :open do
exec '(command -v xdg-open >/dev/null 2>&1 && xdg-open build/html/index.html) || open build/html/index.html'
end
desc "Build docs using pipenv (shortcut)"
task :build => ["pipenv:build"]
task :clean => ["pipenv:clean"]