Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@
default['jekyll']['domain_name'] = node['fqdn']

default['jekyll']['packages'] = []
default['jekyll']['command'] = 'jekyll'
default['jekyll']['options'] = []

default['jekyll']['gem']['source'] = 'https://rubygems.org/'
default['jekyll']['gem']['binary'] = nil

default['jekyll']['rbenv']['activated'] = false
default['jekyll']['rbenv']['version'] = '1.9.3-p194'

default['jekyll']['apache']['enabled'] = false
4 changes: 3 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name 'jekyll'
maintainer "Mike Adolphs"
maintainer_email "[email protected]"
license "Apache 2.0"
description "Installs/Configures a Jekyll blog"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.0"
version "0.1.10"

depends "rbenv" # http://fnichol.github.com/chef-rbenv/
depends "apache2"

supports "debian"
supports "centos"
21 changes: 13 additions & 8 deletions recipes/_deploy_blog.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
execute "jekyll-build" do
cwd node['jekyll']['deploy_directory']
command "jekyll build"
action :nothing
only_if "test -f /var/chef/cache/jekyll_bootstrapped"
end

git node['jekyll']['deploy_directory'] do
repository node['jekyll']['repository']
reference node['jekyll']['reference']
user node['jekyll']['user']
group node['jekyll']['group']

action :sync
notifies :run, 'execute[jekyll-build]', :immediately
end

# Build command with options if defined for blog generation
unless node['jekyll']['options'].empty?
options = node['jekyll']['options'].each { |opt| opt.prepend('--')}
options = options.join(' ')
jekyll_command = "jekyll #{options}"
options = node['jekyll']['options'].join(' ')
jekyll_command = "#{node['jekyll']['command']} #{options}"
else
jekyll_command = "jekyll"
jekyll_command = "#{node['jekyll']['command']}"
end

unless node['jekyll']['rbenv']['activated']
execute 'Deploy Jekyll blog' do
cwd node['jekyll']['deploy_directory']

command "bundle install && #{jekyll_command}"
command "bundle install && #{jekyll_command} && touch /var/chef/cache/jekyll_bootstrapped"
action :run
not_if "test -f /var/chef/cache/jekyll_bootstrapped"
end
else
rbenv_script 'Deploy Jekyll blog' do
rbenv_version node['jekyll']['rbenv']['version']
root_path node['rbenv']['root_path']
cwd node['jekyll']['deploy_directory']

code %{ bundle install && source /etc/profile.d/rbenv.sh && #{jekyll_command} }
end
end
2 changes: 2 additions & 0 deletions recipes/_setup_webserver.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
return if node['jekyll']['apache']['enabled'] == false

domain_name = node['jekyll']['domain_name']

web_app "jekyll-#{domain_name}" do
Expand Down