You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,26 +25,30 @@ Order matters for this buildpack to work. Here's the run order that you should s
25
25
26
26
27
27
## Customize the following config variables:
28
-
1.`PLAYWRIGHT_BUILDPACK_BROWSERS` accepts a comma-separated list of the browser names`chromium,firefox,webkit`. By default, it's installing the executables for all these browsers.
28
+
1.`PLAYWRIGHT_BUILDPACK_BROWSERS` accepts a comma-separated list of the browser names. By default, it's installing executables for `chromium,firefox,webkit`.
29
29
- E.g. To only install Chromium dependencies, set the variable to `chromium`. This will reduce the slug size in the end too.
30
30
-**NOTE**: this is what the author uses, usage with the other 2 browsers are unknown. Feel free to test them out and let me know if they work and I'll update the docs.
31
31
- This config variable is intended to be shared with [heroku-playwright-buildpack](https://github.com/playwright-community/heroku-playwright-buildpack).
32
32
2.`BUILDPACK_BROWSERS_INSTALL_PATH` is the path where the browsers will be installed. Its default value is `browsers` and it's a relative path starting from the [`BUILD_DIR`](https://devcenter.heroku.com/articles/buildpack-api#bin-compile) (the starting directory of the compiled slug to be used by Heroku). It's necessary to have the installed browsers within the `BUILD_DIR` to have the file included by the time Heroku starts the dyno.
33
33
- E.g. To install in the directory `utils/browsers`, set the variable to `utils/browsers`.
34
-
- This config variable is exported by the buildpack for your use in the next step
35
34
36
-
## Modify your browser init script
35
+
## Modify your browser creation script
37
36
38
-
Since the browsers are installed in a non-default location, we have to specify the executable path when we create the browser instances.
37
+
Since the browsers are installed in a non-default location, we have to specify the executable path when we create the browser instances. The following config variables are exported by the buildpack IF the appropriate browsers are installed:
38
+
-`CHROMIUM_EXECUTABLE_PATH`
39
+
-`FIREFOX_EXECUTABLE_PATH`
40
+
-`WEBKIT_EXECUTABLE_PATH`
39
41
40
-
Here's how you should create your browser:
42
+
For example, if you use `PLAYWRIGHT_BUILDPACK_BROWSERS=chromium`, the script will only install the executable for Chromium and only `CHROMIUM_EXECUTABLE_PATH` will be set.
43
+
44
+
Here's how you should create your browser using the config variable above:
@@ -59,8 +63,13 @@ The command to install the system packages along with the browser is `playwright
59
63
Here are a few things to consider:
60
64
- This buildpack is meant for Python Playwright and was developed with Chromium in mind. Any other browser/Playwright distro is not tested by me so I offer no guarantees there
61
65
- Verify that the installation is successful. Look at the build logs, you should see progress bar for the executable installations
66
+
- Verify that the executable paths are properly set. Look through the logs for something like this
67
+
```
68
+
```
62
69
- You can also `heroku run bash` into the dyno and search for the installation folder to verify that the exe are downloaded.
63
70
64
-
# Notes
65
-
This was developed for usage with `playwright` for Python
71
+
# Credits
72
+
A lot of code and patterns were borrowed from [heroku-playwright-buildpack](https://github.com/playwright-community/heroku-playwright-buildpack).
73
+
74
+
Idea for the buildpack were borrowed from [playwright-python-heroku-buildpack](https://github.com/binoche9/playwright-python-heroku-buildpack).
Copy file name to clipboardExpand all lines: bin/compile
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -31,29 +31,28 @@ echo "-----> BUILDPACK_BROWSERS_INSTALL_PATH is $BUILDPACK_BROWSERS_INSTALL_PATH
31
31
echo"-----> Browsers will be installed in $PLAYWRIGHT_BROWSERS_PATH"
32
32
echo"-----> Installing Playwright executables (env: PLAYWRIGHT_BUILDPACK_BROWSERS) for ${PLAYWRIGHT_BUILDPACK_BROWSERS} (formatted value for command line is '${PLAYWRIGHT_BUILDPACK_BROWSERS//,/ }')."
0 commit comments