-
Notifications
You must be signed in to change notification settings - Fork 20
/
Rakefile
70 lines (57 loc) · 1.63 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# ---------------------------------------
# Rakefile
# ---------------------------------------
# Help
#
# rake -> Default to rake help
# rake help -> List all tasks with a description
task :help do
puts "\n"
puts "List of all available tasks"
puts "---------------------------"
puts "\n"
system("rake -sT")
puts "\n"
end
# default to help message
task :default => ["help"]
# END Help
# Install
#
# rake install -> Default to rake install:global
# rake install:global -> Install gems' dependencies system-wide
# rake install:local -> Install gems' dependencies in vendor/bundle directory"
namespace 'install' do
# Install all gems globally (default)
task :global do
puts "Installing Jekyll and all dependencies..."
system("bundle install")
end
desc "Install gems' dependencies in vendor/bundle directory"
task :local do
puts "Installing Jekyll and all dependencies in vendor/bundle directory..."
system("bundle install --path 'vendor/bundle'")
end
end
desc "Install all gems globally"
task install: ["install:global"]
# END Install
# Serve
#
# rake serve -> Run Jekyll in production mode
# rake serve:dev -> Run Jekyll in development mode
namespace 'serve' do
# Run Jekyll in production mode (default)
task :prod do
puts "Run Jekyll in production mode..."
system("bundle exec jekyll serve --config _config.yml")
end
desc "Run Jekyll in development mode"
task :dev do
puts "Starting Jekyll in development mode..."
system("bundle exec jekyll serve --config _config.yml,_config.dev.yml")
end
end
desc "Run Jekyll in production mode"
task serve: ["serve:prod"]
# END serve