-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removes runtime installation of chromedriver (#17)
- Adds a convenience script to install chromedriver ad-hoc - Runs bootstrap_chromedriver script as part of travis install phase; this is not packaged or installed as part of the plugin's install process - Updates README with chromedriver bootstrapping instructions for developers who want to test locally
- Loading branch information
Tom Thorogood
authored
Jun 10, 2020
1 parent
3ef11b0
commit 7bfcb53
Showing
6 changed files
with
82 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This is meant as a developer tool so that developers can easily install chromedriver to their system for | ||
# testing locally. This can also be used inside automation scripts to install the chromedriver in a production | ||
# environment. | ||
|
||
# You can set CHROMEDRIVER_DIR in order to customize | ||
# the output location of the installed binary, and CHROMEDRIVER_DIST to customize the appropriate | ||
# driver distribution; distributions should be provided in the format "linux64", "mac64", "win32," etc. | ||
# By default CHROMEDRIVER_DIR is assumed to be the virtualenv bin directory, and the distribution is assumed to be | ||
# linux64. | ||
# | ||
# To install in your virtualenv on a mac (a developer use case): | ||
# CHROMEDRIVER_DIST=mac64 ./bootstrap_chromedriver.sh | ||
# | ||
# To install in /usr/local/bin on linux (a VM/container use case): | ||
# CHROMEDRIVER_DIR=/usr/local/bin CHROMEDRIVER_DIST=linux64 sudo ./bootstrap_chromedriver.sh | ||
|
||
set -e | ||
CHROMEDRIVER_DIR=${CHROMEDRIVER_DIR:-env/bin} | ||
CHROMEDRIVER_DIST=${CHROMEDRIVER_DIST:-linux64} | ||
export CHROMEDRIVER_BIN="${CHROMEDRIVER_DIR}/chromedriver" | ||
export CHROMEDRIVER_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE) | ||
CHROMEDRIVER_URL="https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_${CHROMEDRIVER_DIST}.zip" | ||
|
||
# Create the destination dir if it does not already exist, and remove any existing chromedriver binaries | ||
test -d "${CHROMEDRIVER_DIR}" || mkdir -p "${CHROMEDRIVER_DIR}" | ||
test -f "${CHROMEDRIVER_BIN}" && rm "${CHROMEDRIVER_BIN}" | ||
|
||
echo "Installing chromedriver ${CHROMEDRIVER_VERSION} for ${CHROMEDRIVER_DIST} to ${CHROMEDRIVER_DIR}" | ||
curl "${CHROMEDRIVER_URL}" > /tmp/chromedriver.zip | ||
unzip /tmp/chromedriver.zip -d "${CHROMEDRIVER_DIR}" | ||
chmod 755 "${CHROMEDRIVER_DIR}/chromedriver" | ||
export PATH="${PATH}:${CHROMEDRIVER_DIR}" |
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
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
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