Skip to content

Commit

Permalink
Merge remote-tracking branch 'base/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
SebouChu committed Jul 22, 2024
2 parents 4fb155c + 5ca79f0 commit dc27669
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
stack: [scalingo-18, scalingo-20]
stack: [scalingo-20, scalingo-22]
channel: [stable, beta, unstable]
runs-on: ubuntu-latest

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ All notable changes to this project will be documented in this file.

## Scalingo buildpack

### 2024-07-22
- Sync fork with Heroku's base repository, removing deprecation warning.

### 2022-09-13
- Changed stack check from Heroku-X to Scalingo-x.

## Heroku original buildpack

### 2024-05-30
- Deprecates support in Heroku-22 and Heroku-20.
- Adds explicit error for Heroku-24

### 2022-05-19
- Added support for Heroku-22.

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE
FROM $BASE_IMAGE
USER root

ARG STACK
ARG GOOGLE_CHROME_CHANNEL
Expand Down
38 changes: 12 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
This buildpack downloads and installs (headless) Google Chrome from your choice
of release channels.

> [!IMPORTANT]
> When used with Chromedriver, the Chromedriver version (installed by a different buildpack) falls out of sync with Chrome causing build failures.
>
> **Instead, please use [Chrome for Testing buildpack](https://github.com/heroku/heroku-buildpack-chrome-for-testing)**, which installs [matching Chrome + Chromedriver versions](https://googlechromelabs.github.io/chrome-for-testing/).
## Channels

You can choose your release channel by specifying `GOOGLE_CHROME_CHANNEL` as
Expand All @@ -23,32 +28,13 @@ the selected channel.

## Selenium

To use Selenium with this buildpack, you'll also need Chrome's webdriver.
This buildpack does not install chromedriver, but there is a
[chromedriver buildpack](https://github.com/heroku/heroku-buildpack-chromedriver)
also available.

Additionally, chromedriver expects Chrome to be installed at `/usr/bin/google-chrome`,
but that's a read-only filesystem in a Scalingo slug. You'll need to tell Selenium/chromedriver
that the chrome binary is at `/app/.apt/usr/bin/google-chrome` instead.

To make that easier, this buildpack makes `$GOOGLE_CHROME_BIN`, and
`$GOOGLE_CHROME_SHIM` available as environment variables. With them, you can
use the standard location locally and the custom location on Heroku. An example
configuration for Ruby's Capybara:

```ruby
chrome_bin = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
> [!CAUTION]
> To use Selenium, do not install this buildpack.
>
> **Instead, please use [Chrome for Testing buildpack](https://github.com/heroku/heroku-buildpack-chrome-for-testing)**, which installs [matching Chrome + Chromedriver versions](https://googlechromelabs.github.io/chrome-for-testing/).
chrome_opts = chrome_bin ? { "chromeOptions" => { "binary" => chrome_bin } } : {}
## Releasing a new version

Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(chrome_opts)
)
end
Make sure you publish this buildpack in the buildpack registry

Capybara.javascript_driver = :chrome
```
`heroku buildpacks:publish heroku/google-chrome master`

0 comments on commit dc27669

Please sign in to comment.