ci: fix incompatible node version in builder image

This commit is contained in:
Rainer Killinger
2022-10-10 14:33:19 +02:00
parent c86880da39
commit 4056f09448
2 changed files with 10 additions and 2 deletions

View File

@@ -73,8 +73,8 @@ docker image cypress:
services:
- docker:dind
script:
- export CHROME_VERSION=$(curl -s https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions | jq -r '.versions[0].version')
- export FIREFOX_VERSION=$(curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')
- export CHROME_VERSION=$(curl -fsSL https://versionhistory.googleapis.com/v1/chrome/platforms/linux/channels/stable/versions | jq -r '.versions[0].version')
- export FIREFOX_VERSION=$(curl -fsSL https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com/openstapps/projectmanagement/
- docker build --build-arg CHROME_VERSION=$CHROME_VERSION --build-arg FIREFOX_VERSION=$FIREFOX_VERSION -t registry.gitlab.com/openstapps/projectmanagement/cypress -f images/cypress/Dockerfile images/cypress
- docker push registry.gitlab.com/openstapps/projectmanagement/cypress

View File

@@ -1,7 +1,15 @@
FROM docker/compose
ARG NODE_VERSION="14"
RUN apk update && apk add nodejs npm git jq curl
RUN export DOWNLOAD_VERSION=$(curl -fsSL --compressed https://unofficial-builds.nodejs.org/download/release/index.json | \
jq --raw-output ".[]|select(.version | startswith(\"v$NODE_VERSION\"))|.version" | head -1) && \
curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/$DOWNLOAD_VERSION/node-$DOWNLOAD_VERSION-linux-x64-musl.tar.xz" && \
tar -xJf "node-$DOWNLOAD_VERSION-linux-x64-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner && \
ln -sf /usr/local/bin/node /usr/local/bin/nodejs
ADD . /opt/openstapps/projectmanagement
WORKDIR /opt/openstapps/projectmanagement