Skip to content

Commit b6754a2

Browse files
committed
added sh script to run Cypress on Docker container
1 parent c26965f commit b6754a2

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Dockerfile

-7
This file was deleted.

cy-run.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
echo "Running Cypress tests headlessly without copying files"
3+
4+
# explanation of the "docker run" command line arguments
5+
#
6+
# -it = interactive terminal
7+
# -v $PWD:/e2e = map current folder to /e2e inside the container
8+
# -w /e2e = set working directy to /e2e
9+
# $@ = pass any arguments to this script to the Cypress command
10+
# like "./cy-run.sh --record"
11+
#
12+
# Docker image "cypress/included:3.2.0" has its entrypoint
13+
# set to "cypress run" by default
14+
docker run -it -v $PWD:/integration -w /integration cypress/included:7.6.0 $@
15+
16+
# if you need to restrict amount of memory or CPU power the
17+
# container can use, see
18+
# https://docs.docker.com/config/containers/resource_constraints/
19+
# restrict total memory
20+
# --memory=600m --memory-swap=600m
21+
# restrict CPU share
22+
# --cpus=0.3

0 commit comments

Comments
 (0)