Created
May 19, 2012 11:30
-
-
Save bradleypriest/2730526 to your computer and use it in GitHub Desktop.
Rubber wkhtmltopdf recipe
This file contains 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
namespace :rubber do | |
namespace :pdf do | |
after "rubber:install_packages", "rubber:pdf:install_wkhtmltopdf" | |
desc "install wkhtmltopdf see http://stackoverflow.com/questions/9672070/wicked-pdf-on-production-server/9687535#9687535 for details" | |
task :install_wkhtmltopdf, roles: :app do | |
sudo_script 'install_wkhtmltopdf', <<-ENDSCRIPT | |
if ! which wkhtmltopdf &> /dev/null; then | |
apt-get install -y wkhtmltopdf | |
apt-get remove -y wkhtmltopdf --purge | |
cd /usr/local/bin | |
curl -C - -O http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
tar -xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
ln -s wkhtmltopdf-amd64 wkhtmltopdf | |
fi | |
ENDSCRIPT | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment