mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-13 03:52:55 +01:00
Cache chromium driver version
This commit is contained in:
parent
9d5972d125
commit
4ab75d3040
2 changed files with 66 additions and 65 deletions
|
|
@ -15,24 +15,33 @@ function build_debian() {
|
|||
|
||||
# We hard code the URL rather than using $CI_API_V4_URL $CI_PROJECT_ID,
|
||||
# because we would need to forward those variables
|
||||
CHROME_DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${PKG}"
|
||||
CHROME_DEB="${PKG}_${CHROME_VERSION}_${ARCH}.deb"
|
||||
CHROME_URL="${CHROME_DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${CHROME_DEB}"
|
||||
DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${PKG}"
|
||||
BROWSER_DEB="${PKG}_${CHROME_VERSION}_${ARCH}.deb"
|
||||
BROWSER_URL="${DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${BROWSER_DEB}"
|
||||
|
||||
echo "Downloading deb file from Package registry: $CHROME_URL"
|
||||
curl --silent --show-error --fail -O $CHROME_URL
|
||||
dpkg -i ./$CHROME_DEB || true
|
||||
echo "Installing browser"
|
||||
curl --silent --show-error --fail -O "$BROWSER_URL"
|
||||
dpkg -i "./${BROWSER_DEB}" || true
|
||||
apt-get install -f -y
|
||||
rm -f $CHROME_DEB
|
||||
rm -f "$BROWSER_DEB"
|
||||
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
echo "Installing webdriver"
|
||||
if [ "${ARCH}" == "amd64" ]; then
|
||||
CHROME_VERSION_BASE=$(echo $CHROME_VERSION | awk -F "." '{print $1 "." $2 "." $3}')
|
||||
CHROME_DRIVER_VERSION=$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION_BASE)
|
||||
|
||||
# Install ChromeDriver
|
||||
CHROME_VERSION_BASE=$(echo $CHROME_VERSION | awk -F "." '{print $1 "." $2 "." $3}')
|
||||
CHROME_DRIVER_VERSION=$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION_BASE)
|
||||
wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip
|
||||
unzip chromedriver_linux64.zip -d /usr/local/bin
|
||||
rm -f chromedriver_linux64.zip
|
||||
wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip
|
||||
unzip chromedriver_linux64.zip -d /usr/local/bin
|
||||
rm -f chromedriver_linux64.zip
|
||||
else
|
||||
DRIVER_DEB="${PKG}-driver_${CHROME_VERSION}_${ARCH}.deb"
|
||||
DRIVER_URL="${DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${DRIVER_DEB}"
|
||||
|
||||
curl --silent --show-error --fail -O "$DRIVER_URL"
|
||||
dpkg -i "./${DRIVER_DEB}" || true
|
||||
apt-get install -f -y
|
||||
rm -f "$DRIVER_DEB"
|
||||
fi
|
||||
|
||||
apt-get autoremove -yq
|
||||
apt-get clean -yqq
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue