-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Update base image to latest version
cypress/base:latest is used instead of 12.14.0. The download URL for the Cypress binary is fixed. The build is restructed: a shell script is used to reduce image layer amount and size. Reformat files with Prettier / shfmt. A verify step is added to the GitHub action.
- Loading branch information
Showing
6 changed files
with
128 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{*.sh,Dockerfile}] | ||
binary_next_line = true | ||
switch_case_indent = true | ||
space_redirects = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.defaultFormatter": null, | ||
"[dockerfile]": { | ||
"editor.defaultFormatter": "foxundermoon.shell-format" | ||
}, | ||
"shellformat.flag": "--binary-next-line --case-indent" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
FROM cypress/base:latest | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG C.UTF-8 | ||
ARG cypressVersion=3.8.3 | ||
|
||
# Update package lists and bring all package up to date. | ||
RUN apt-get update && apt-get dist-upgrade -y | ||
COPY ./build.sh /opt/build.sh | ||
|
||
RUN apt-get install -y curl | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV CYPRESS_INSTALL_BINARY="/opt/cypress/cypress.zip" | ||
ENV CYPRESS_VERSION="$cypressVersion" | ||
|
||
# Download Cypress binary | ||
RUN mkdir /opt/cypress && curl -sS https://cdn.cypress.io/desktop/3.8.1/linux-x64/cypress.zip >/opt/cypress/cypress.zip | ||
RUN bash /opt/build.sh "${cypressVersion}" | ||
|
||
# Cleanup | ||
RUN apt-get purge -y curl && apt-get --purge -y autoremove && apt-get autoclean && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ENV CYPRESS_RUN_BINARY="/opt/cypress/cypress.zip" | ||
RUN rm /opt/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cypressVersion="$1" | ||
|
||
echo "Building for Cypress version ${cypressVersion}" | ||
|
||
# Update package lists and bring all package up to date. | ||
apt-get update | ||
apt-get dist-upgrade -y | ||
|
||
# Install dependencies for install scripts. | ||
apt-get install -y \ | ||
curl | ||
|
||
# Install Cypress dependencies | ||
apt-get install -y \ | ||
libgtk2.0-0 \ | ||
libgtk-3-0 \ | ||
libgbm-dev \ | ||
libnotify-dev \ | ||
libgconf-2-4 \ | ||
libnss3 \ | ||
libxss1 \ | ||
libasound2 \ | ||
libxtst6 \ | ||
xauth \ | ||
xvfb | ||
|
||
# Download Cypress binary | ||
mkdir /opt/cypress | ||
curl -sS "https://cdn.cypress.io/desktop/${cypressVersion}/linux-x64/cypress.zip" >/opt/cypress/cypress.zip | ||
|
||
# Cleanup | ||
apt-get purge -y \ | ||
curl | ||
apt-get --purge -y autoremove | ||
apt-get autoclean | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd "$HOME" | ||
|
||
npm install "cypress@${CYPRESS_VERSION}" | ||
|
||
npx cypress verify |