Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 252ff6fc authored by flothoni's avatar flothoni
Browse files

Add cypress dockerfile

This dockercfile allow to build the image to use for our automated pipeline
Already have 4 browsers: legacy and latest, for firefox and chrome
The builded image is use for gitlab-ci testing
parent d202bfb3
FROM ubuntu:20.04
LABEL version="0.1"
LABEL description="An Cypress based docker image which comes with cypress pipeline and various browsers version."
WORKDIR /app
COPY cypress.json .
COPY package.json .
COPY cypress_script.bash script.bash
##################################
### Update and install ressources
##################################
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Paris"
RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y -q npm libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb wget bzip2 tar unzip nano curl ca-certificates make &&\
wget -qO- https://deb.nodesource.com/setup_14.x | bash - &&\
apt install -y nodejs &&\
mkdir -p /etc/ssl/certs/ /app/browsers
######################
### download browsers
######################
# https://chromium.cypress.io/; allow to get old versions of chromium
RUN curl -Lo firefox_latest.tar.bz2 'https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US' &&\
tar -xjf firefox_latest.tar.bz2 &&\
mv firefox browsers/firefox_latest &&\
wget -q http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/886661/chrome-linux.zip &&\
unzip -q chrome-linux.zip &&\
mv chrome-linux browsers/chrome_latest &&\
wget -q https://ftp.mozilla.org/pub/firefox/releases/62.0/linux-x86_64/fr/firefox-62.0.tar.bz2 &&\
tar -xjf firefox-62.0.tar.bz2 && mv firefox browsers/firefox_legacy &&\
wget -q http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/652428/chrome-linux.zip &&\
unzip -q chrome-linux.zip &&\
mv chrome-linux browsers/chrome_legacy &&\
rm chrome-linux.zip chrome-linux.zip.1 firefox-62.0.tar.bz2 firefox_latest.tar.bz2
RUN npm i cypress && $(npm bin)/cypress verify
{
"reporter": "junit",
"reporterOptions": {
"mochaFile": "cypress/reports/test-cypress-[hash].xml"
},
"pluginsFile": false
}
echo "$ change chmod of cypress directory"
chmod 777 cypress -R
echo -e "$ ./node_modules/cypress/bin/cypress run --browser $BROWSER --headless --env workdir=vidjil,host=$HOST"
./node_modules/cypress/bin/cypress run --browser $BROWSER --headless --env workdir=vidjil,host=$HOST
ECODE=$?
echo "$ change again chmod of cypress directory (include new directories)"
chmod 777 cypress -R
echo -e "exit code: $ECODE"
if [ "$ECODE" -ne 0 ]; then echo "command failed"; exit 1; fi
exit 0
\ No newline at end of file
{
"name": "pji_project",
"version": "0.1.0",
"private": true,
"eslintConfig": {},
"devDependencies": {
"cypress": "^7.2.0"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment