Skip to content

Commit

Permalink
Use latest Chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhidki committed Aug 4, 2023
1 parent d201004 commit 89c593e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions timApp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ RUN sed -i "s/port=port, use_reloader=False/host='0.0.0.0', port=port, use_reloa
# Fix newest Werkzeug incompatibility
RUN sed -i "s/from werkzeug import cached_property/from werkzeug.utils import cached_property/" /usr/local/lib/${PYTHON}/dist-packages/flask_testing/utils.py

RUN wget -q http://mirrors.ctan.org/support/latexmk/latexmk.pl -O /usr/bin/latexmk
RUN wget -q https://www.texlive.info/CTAN/support/latexmk/latexmk.pl -O /usr/bin/latexmk

# Chromedriver (for running tests)
# Taken from https://github.com/SeleniumHQ/docker-selenium/blob/trunk/NodeChrome/Dockerfile
Expand All @@ -191,16 +191,25 @@ RUN wget -q https://raw.githubusercontent.com/SeleniumHQ/docker-selenium/trunk/N
RUN /usr/local/bin/wrap_chrome_binary

ARG CHROME_DRIVER_VERSION
RUN if [ -z "$CHROME_DRIVER_VERSION" ]; \
then CHROME_MAJOR_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+)(\.[0-9]+){3}.*/\1/") \
&& CHROME_DRIVER_VERSION=$(wget --no-verbose -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}"); \
RUN bash -c "${APT_INSTALL} jq && ${APT_CLEANUP}"
RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \
then CHROME_DRIVER_URL=https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_DRIVER_VERSION/linux64/chromedriver-linux64.zip ; \
else echo "Geting ChromeDriver binary from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" \

Check warning on line 197 in timApp/Dockerfile

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Geting" should be "Getting".
&& CFT_URL=https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json \
&& CFT_CHANNEL="Stable" \
&& if [ "$(echo "$CHROME_VERSION" | grep -q "beta")" ]; then CFT_CHANNEL="Beta"; fi \
&& if [ "$(echo "$CHROME_VERSION" | grep -q "unstable")" ]; then CFT_CHANNEL="Dev"; fi \
&& CTF_VALUES=$(curl -sSL $CFT_URL | jq -r --arg CFT_CHANNEL "$CFT_CHANNEL" '.channels[] | select (.channel==$CFT_CHANNEL)') \
&& CHROME_DRIVER_VERSION=$(echo $CTF_VALUES | jq -r '.version' ) \
&& CHROME_DRIVER_URL=$(echo $CTF_VALUES | jq -r '.downloads.chromedriver[] | select(.platform=="linux64") | .url' ) ; \
fi \
&& echo "Using chromedriver version: "$CHROME_DRIVER_VERSION \
&& wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
&& echo "Using ChromeDriver from: "$CHROME_DRIVER_URL \
&& echo "Using ChromeDriver version: "$CHROME_DRIVER_VERSION \
&& wget --no-verbose -O /tmp/chromedriver_linux64.zip $CHROME_DRIVER_URL \
&& rm -rf /opt/selenium/chromedriver \
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
&& rm /tmp/chromedriver_linux64.zip \
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
&& mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
&& ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver

Expand Down

0 comments on commit 89c593e

Please sign in to comment.