-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 1015 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM cypress/included:13.17.0
# Copy of the source for code coverage analysis
WORKDIR /app
COPY src/. ./
RUN --mount=type=secret,id=npm_token \
( [ ! -s /run/secrets/npm_token ] || npm config set //registry.npmjs.org/:_authToken="$(cat /run/secrets/npm_token)" ) && \
npm install --legacy-peer-deps
RUN npx nyc instrument --compact=false . --in-place
# Cypress E2E
WORKDIR /e2e
RUN apt-get -y update; apt-get -y install curl
COPY e2e/package.json /e2e
COPY e2e/package-lock.json /e2e
RUN --mount=type=secret,id=npm_token \
( [ ! -s /run/secrets/npm_token ] || npm config set //registry.npmjs.org/:_authToken="$(cat /run/secrets/npm_token)" ) && \
npm install
COPY e2e/cypress.config.ts /e2e
COPY e2e/tsconfig.json /e2e
COPY e2e/*.yml /e2e
COPY e2e/entrypoint.sh /tmp
ADD e2e/cypress /e2e/cypress
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/latest/download/gwa_Linux_x86_64.tgz \
&& tar -xzf gwa_Linux_x86_64.tgz \
&& mv gwa /usr/local/bin/.
ENTRYPOINT ["npm", "run", "cy:run:html"]