Skip to content

Commit

Permalink
fix to symlink chrome executable
Browse files Browse the repository at this point in the history
  • Loading branch information
briri committed Jun 27, 2024
1 parent 4210897 commit c648527
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
task :chrome_install do
on roles(:app), wait: 1 do
unless Dir.exist?("#{release_path}/.cache/puppeteer/chrome")
execute "cd #{release_path} && npx puppeteer browsers install chrome"
execute "cd #{release_path} && CHROME_PATH=$(npx puppeteer browsers install chrome@stable) && ln -s $(echo $CHROME_PATH | awk '{print $2}') ./bin/chrome"

# Add step to clean up old versions and just always run this on each deploy
# Check to see if we can peg the version if we need to or at least lock it
Expand Down
6 changes: 1 addition & 5 deletions config/initializers/grover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
# - Then rebuild the font index/cache `fc-cache -f -v`
# - Verify that both the Roboto and Tinos fonts are installed: `fc-list`
#

dflt_executable_path = Rails.root.join('.cache', 'puppeteer', 'chrome', 'linux-126.0.6478.61',
'chrome-linux64', 'chrome')

Grover.configure do |config|
config.options = {
format: 'letter',
Expand All @@ -35,7 +31,7 @@
# Tell Puppeteer to use headless Chrome
headless: true,
# Tells Puppeteer where the Chromium executable lives. Update this when Chrome is updated!
executable_path: ENV.fetch('CHROMIUM_PATH', dflt_executable_path),
executable_path: ENV.fetch('CHROMIUM_PATH', Rails.root.join('bin', 'chrome')),

launch_args: ['--font-render-hinting=medium', '--no-sandbox', '--disable-setuid-sandbox'],
wait_until: 'networkidle0',
Expand Down

0 comments on commit c648527

Please sign in to comment.