Browse Source

jibri: simplify ChromeDriver download

Saúl Ibarra Corretgé 1 year ago
parent
commit
a76b1f4
2 changed files with 7 additions and 5 deletions
  1. 1 2
      jibri/Dockerfile
  2. 6 3
      jibri/rootfs/usr/bin/install-chrome.sh

+ 1 - 2
jibri/Dockerfile

@@ -11,9 +11,8 @@ LABEL org.opencontainers.image.documentation="https://jitsi.github.io/handbook/"
 ARG TARGETPLATFORM
 ARG USE_CHROMIUM=0
 #ARG CHROME_RELEASE=latest
-#ARG CHROMEDRIVER_MAJOR_RELEASE=latest
+# https://googlechromelabs.github.io/chrome-for-testing/
 ARG CHROME_RELEASE=116.0.5845.96
-ARG CHROMEDRIVER_MAJOR_RELEASE=116
 
 COPY rootfs/ /
 

+ 6 - 3
jibri/rootfs/usr/bin/install-chrome.sh

@@ -21,10 +21,13 @@ else
 
     google-chrome --version
 
-    if [ "${CHROMEDRIVER_MAJOR_RELEASE}" = "latest" ]; then
-        CHROMEDRIVER_RELEASE="$(curl -4Ls https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE)"
+    BASE_URL=https://googlechromelabs.github.io/chrome-for-testing
+
+    if [ "${CHROME_RELEASE}" = "latest" ]; then
+        CHROMEDRIVER_RELEASE="$(curl -4Ls ${BASE_URL}/LATEST_RELEASE_STABLE)"
     else
-        CHROMEDRIVER_RELEASE="$(curl -4Ls https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})"
+        CHROMEDRIVER_MAJOR_RELEASE=$(echo $CHROME_RELEASE | cut -d. -f1)
+        CHROMEDRIVER_RELEASE="$(curl -4Ls ${BASE_URL}/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})"
     fi
 
     CHROMEDRIVER_ZIP="/tmp/chromedriver_linux64.zip"