This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_inline_resources if defined?(use_inline_resources) | |
def whyrun_supported? | |
true | |
end | |
action :create do | |
template new_resource.name do | |
group new_resource.group | |
mode new_resource.mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'tempfile' | |
action :ensure do | |
t_file = Tempfile.new('/root/.profile_temp') | |
::File.open(new_resource.profile, 'r') do |f| | |
f.each_line do |line| | |
if line.match(/PATH=/) | |
if ::File.readlines(new_resource.profile).grep(/:#{new_resource.path.gsub('/','\/')}/).length > 0 | |
t_file.puts line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"mysql": { | |
"tunable": { | |
"innodb_log_file_size": "8M", | |
"key_buffer_size": "128M" | |
} | |
}, | |
"drupal": { | |
"sites": { | |
"drupal": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute "drush-site-install" do | |
drupal_user = data_bag_item('users', 'drupal')[node.chef_environment] | |
install = site[:install] | |
if site[:database].nil? | |
cmd = "drush -y site-install #{site[:profile]}" | |
install.each do |flag, value| | |
cmd << " #{flag}=#{value}" | |
end | |
cmd << " --db-url=mysql://#{drupal_user['dbuser']}:#{drupal_user['dbpass']}@localhost/#{site_name}" if install['db-url'].nil? | |
cmd << " --account-name=#{drupal_user['admin_user']}" if install['account-name'].nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'tempfile' | |
action :ensure do | |
t_file = Tempfile.new('/root/.profile_temp') | |
::File.open(new_resource.profile, 'r') do |f| | |
f.each_line do |line| | |
if line.match(/PATH=/) | |
if ::File.readlines(new_resource.profile).grep(/:#{new_resource.path.gsub('/','\/')}/).length > 0 | |
t_file.puts line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files_sorted_by_time = Dir["#{node[:drupal][:server][:base]}/#{site_name}/releases/*"].sort_by{ |f| File.mtime(f) } | |
previous_release = files_sorted_by_time.length > 1 ? files_sorted_by_time[1] : files_sorted_by_time[0] | |
command <<-EOF | |
cp #{files_sorted_by_time[file_index]}/#{site[:settings]} #{release_path}/#{site[:settings]} | |
EOF | |
only_if { ::File.exists?("#{files_sorted_by_time[-2]}/#{site[:settings]}") } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clean_releases(vars) | |
directories = [] | |
Dir.entries(vars[:directory]).each do |f| | |
directories.push f if (f=~/^#{vars[:app_name]}-[0-9]+/) | |
end | |
directories.sort.reverse.drop(vars[:quantity]).each do |i| | |
system "rm -rf #{vars[:directory]}/#{i}" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drupal is a vivid and exciting community, creating and maintaining an ecosystem | |
of talent in many different areas of knowledge. When it comes to discussing and | |
embracing the future of Drupal, developers are the front line, making sure we | |
are capable of meeting our clients needs while delivering performant applications | |
more efficiently and securely. | |
The Coding and Development track for Drupalcon Sao Paoulo is dedicated to | |
the new options, capabilities and direction that will shape the future of Drupal. | |
We will offer many must-see sessions with a focus on the RESTful future of | |
Drupal and harnessing the power of the Symfony framework. We will introduce you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dirty ruby syslog | |
def log(msg) | |
Syslog.open($0, Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning "#{msg}" } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Move into the jenkins directory | |
cd /var/lib/jenkins | |
#Add all top level xml files. | |
git add *.xml | |
# Add all job config.xml files. | |
git add jobs/*/config.xml | |
# Add all user config.xml files. |