Commit b16394db authored by William Chia's avatar William Chia

working script with dfs generated

parent fe0e8ab6
Pipeline #30325362 failed with stages
in 14 minutes and 41 seconds
......@@ -450,7 +450,7 @@ task :comparison_pdfs do
end
end
desc 'Comparison PDFS'
desc 'Comparison PDFS Alt'
task :comparison_pdfs_alt do
file = YAML.load_file('data/features.yml')
file['competitors'].each do |key, competitor|
......
#!/bin/bash
set -e
filename=$1
pdffilename=$2
pdffilename=${pdffilename/.html/.pdf}
echo "👉 Generating PDF for $filename..."
wkhtmltopdf --margin-left 0 --margin-right 0 --margin-top 0 -n --javascript-delay 2000 $filename $pdffilename
pdf_gen() {
if [[ $1 -le 1 ]]
then
echo "❌ PDF $pdffilename was generated with errors!"
else
wkhtmltopdf --margin-left 0 --margin-right 0 --margin-top 0 --javascript-delay 2000 $filename $pdffilename > pdf_gen_stderr.log 2>&1
if grep "Warning" pdf_gen_stderr.log
then
echo "Retrying PDF generation"
pdf_gen $1-1
fi
fi
}
pdf_gen 5
echo "✅ PDF $pdffilename generated!"
Loading pages (1/6)
[> ] 0% [======> ] 10% [=============> ] 23% [========================> ] 41% [===========================> ] 45% [====================================> ] 60% [===========================================> ] 72% [============================================================] 100% Counting pages (2/6)
[============================================================] Object 1 of 1 Resolving links (4/6)
[============================================================] Object 1 of 1 Loading headers and footers (5/6)
Printing pages (6/6)
[> ] Preparing [===================> ] Page 1 of 3 [=======================================> ] Page 2 of 3 [============================================================] Page 3 of 3 Done
......@@ -39,11 +39,17 @@ layout: false
FEATURES
%td.text-center
- if (product_one.logo != "null")
%img{ src: "#{product_one.logo}", alt: "#{product_one.name}", class: "logo" }
-# relative path required for wkhtmltopdf
- if product_one.logo.index('.png')
%img{ src: "../..#{product_one.logo}", alt: "#{product_one.name}", class: "logo" }
- else
= partial "../..#{product_one.logo}"
- else
= product_one.name
%td.text-center.table-title-logo
%img{ src: "/images/comparison/gitlab-logo.svg", alt: "GitLab", class: "logo" }
-# relative path required for wkhtmltopdf
-# %img{ src: "../../images/comparison/gitlab-logo.svg", alt: "GitLab", class: "logo" }
= partial "../../images/comparison/gitlab-logo.svg"
- data.features.features.each do |feature|
- if (feature.public_send(key_one) != nil && feature.public_send(key_two) != nil)
%tr
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment