summaryrefslogtreecommitdiff
path: root/Rakefile
blob: 404e661e8a8076ed887045e4c357c85689eb78cb (plain)
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
require 'jekyll'
require 'html-proofer'

task :default => [:buildsite]

desc 'Build the site'
task :buildsite do
	#def Jekyll::env
	#	"production"
	#end
	# fuck this, the whole process won't work unless I figure out how to activate all plugins
	###Jekyll::Commands::Build.process({})
	ENV["JEKYLL_ENV"]="production"
	sh "bundle", "exec", "jekyll", "build"
end

desc 'Clean up built files'
task :clean do
	puts 'Cleaning up _site...'.bold
	Jekyll::Commands::Clean.process({})
end

desc 'Test the site using html-proofer'
task :testsite => [:buildsite] do
  options = { :assume_extension => true, :disable_external => true  }
  HTMLProofer.check_directory("./_site", options).run
end

namespace :deploy do
	desc "Deploy via SSH"
	task :ssh => [:buildsite] do
		sh "rsync", "-av", "_site/", "w019f723.kasserver.com:/www/htdocs/w019f723/blog.uvokchee.de/"
	end

	desc "Deploy via FTP"
	task :ftp => [:buildsite] do
		Dir.chdir "_site"
		# quicker, but possibly error-prone
		# sh "lftp", "-c", "set ftp:ssl-force true ; open w019f723.kasserver.com ; mirror -R --delete  --verbose --ignore-time --no-perms --no-umask; bye"

		# always copy everything
		sh "lftp", "-c", "set ftp:ssl-force true ; open w019f723.kasserver.com ; mirror -R --delete  --verbose --no-perms --no-umask ; bye"
		Dir.chdir ".."

		#sh "cat", "lftp.log"
	end
end