mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 22:12:53 +00:00
ci: add custom cypress image with latest browsers
This commit is contained in:
@@ -62,6 +62,25 @@ docker image node:
|
||||
tags:
|
||||
- secrecy
|
||||
|
||||
docker image cypress:
|
||||
image: registry.gitlab.com/openstapps/projectmanagement/builder
|
||||
stage: build
|
||||
only:
|
||||
variables:
|
||||
- $BUILD_IMAGES == "true"
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
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')
|
||||
- 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
|
||||
tags:
|
||||
- secrecy
|
||||
|
||||
npm audit:
|
||||
allow_failure: true
|
||||
except:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM docker/compose
|
||||
|
||||
RUN apk update && apk add nodejs npm git jq
|
||||
RUN apk update && apk add nodejs npm git jq curl
|
||||
|
||||
ADD . /opt/openstapps/projectmanagement
|
||||
|
||||
|
||||
93
images/cypress/Dockerfile
Normal file
93
images/cypress/Dockerfile
Normal file
@@ -0,0 +1,93 @@
|
||||
# WARNING: this file was autogenerated by generate-browser-image.js
|
||||
# using
|
||||
# yarn add:browser -- 14.19.0 --chrome=100.0.4896.88 --firefox=99.0.1 --edge
|
||||
#
|
||||
# build args added afterwards
|
||||
#
|
||||
FROM cypress/base:14.19.0
|
||||
|
||||
ARG CHROME_VERSION="unknown"
|
||||
ARG FIREFOX_VERSION="unknown"
|
||||
|
||||
USER root
|
||||
|
||||
RUN node --version
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
fonts-liberation \
|
||||
git \
|
||||
libcurl4 \
|
||||
libcurl3-gnutls \
|
||||
libcurl3-nss \
|
||||
xdg-utils \
|
||||
wget \
|
||||
curl \
|
||||
# firefox dependencies
|
||||
bzip2 \
|
||||
# add codecs needed for video playback in firefox
|
||||
# https://github.com/cypress-io/cypress-docker-images/issues/150
|
||||
mplayer \
|
||||
# edge dependencies
|
||||
gnupg \
|
||||
dirmngr \
|
||||
# clean up
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& apt-get clean
|
||||
|
||||
# install libappindicator3-1 - not included with Debian 11
|
||||
RUN wget --no-verbose /usr/src/libappindicator3-1_0.4.92-7_amd64.deb "http://ftp.us.debian.org/debian/pool/main/liba/libappindicator/libappindicator3-1_0.4.92-7_amd64.deb" && \
|
||||
dpkg -i /usr/src/libappindicator3-1_0.4.92-7_amd64.deb ; \
|
||||
apt-get install -f -y && \
|
||||
rm -f /usr/src/libappindicator3-1_0.4.92-7_amd64.deb
|
||||
|
||||
# install Chrome browser
|
||||
RUN wget --no-verbose -O /usr/src/google-chrome-stable_current_amd64.deb "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}-1_amd64.deb" && \
|
||||
dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \
|
||||
apt-get install -f -y && \
|
||||
rm -f /usr/src/google-chrome-stable_current_amd64.deb
|
||||
|
||||
# "fake" dbus address to prevent errors
|
||||
# https://github.com/SeleniumHQ/docker-selenium/issues/87
|
||||
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null
|
||||
|
||||
# install Firefox browser
|
||||
RUN wget --no-verbose -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2" && \
|
||||
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
|
||||
rm /tmp/firefox.tar.bz2 && \
|
||||
ln -fs /opt/firefox/firefox /usr/bin/firefox
|
||||
|
||||
RUN echo "Downloading Latest Edge version..."
|
||||
|
||||
## Setup Edge
|
||||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
|
||||
RUN install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
|
||||
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
|
||||
RUN rm microsoft.gpg
|
||||
|
||||
## Install Edge
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y microsoft-edge-dev
|
||||
|
||||
# Add a link to the browser that allows Cypress to find it
|
||||
RUN ln -s /usr/bin/microsoft-edge /usr/bin/edge
|
||||
|
||||
# versions of local tools
|
||||
RUN echo " node version: $(node -v) \n" \
|
||||
"npm version: $(npm -v) \n" \
|
||||
"yarn version: $(yarn -v) \n" \
|
||||
"debian version: $(cat /etc/debian_version) \n" \
|
||||
"Chrome version: $(google-chrome --version) \n" \
|
||||
"Firefox version: $(firefox --version) \n" \
|
||||
"Edge version: $(edge --version) \n" \
|
||||
"git version: $(git --version) \n" \
|
||||
"whoami: $(whoami) \n"
|
||||
|
||||
# a few environment variables to make NPM installs easier
|
||||
# good colors for most applications
|
||||
ENV TERM=xterm
|
||||
# avoid million NPM install messages
|
||||
ENV npm_config_loglevel=warn
|
||||
# allow installing when the main user is root
|
||||
ENV npm_config_unsafe_perm=true
|
||||
Reference in New Issue
Block a user