-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathRakefile.rb
More file actions
46 lines (39 loc) · 1.12 KB
/
Rakefile.rb
File metadata and controls
46 lines (39 loc) · 1.12 KB
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
require 'rubygems'
task :default => :build
desc "Setup or update the environment to run Awestruct"
task :setup do
system "bundle update"
end
desc "Clean out generated site and temporary files"
task :clean do
require 'fileutils'
['.awestruct', '.sass-cache', '_site', '_tmp'].each do |dir|
FileUtils.remove_dir dir unless !File.directory? dir
end
end
desc "Run in developer mode"
task :dev => :check do
system "bundle exec awestruct -P development --dev"
end
desc "Build the site"
task :build => :check do
system "bundle exec awestruct -P production --force"
end
desc "Build the site and publish"
task :publish => [:check, :clean, :build] do
system("echo Publishing...")
deploy_url = "dashbuilder@filemgmt.jboss.org:/www_htdocs/dashbuilder/"
success = system("rsync -Pqr --protocol=28 --delete-after _site/* #{deploy_url}")
fail unless success
end
task :check do
begin
require 'bundler'
Bundler.setup
rescue StandardError => e
puts "\e[31m#{e.message}\e[0m"
puts "\e[33mRun `rake setup` to install required gems.\e[0m"
exit e.status_code
end
Dir.mkdir('_tmp') unless Dir.exist?('_tmp')
end