Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/aps-cypress-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ env:
GIT_COMMIT_AUTHOR: ${{ github.actor }}
GIT_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GIT_REPO_URL: ${{ github.repository }}
# Optional: avoids npm 403 from registry when multiple images run npm install in parallel
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
cypress-run:
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ x-common-variables: &common-variables
KONG_PG_USER: konguser
KONG_PG_PASSWORD: konguser

secrets:
npm_token:
environment: "NPM_TOKEN"

services:
keycloak:
image: quay.io/keycloak/keycloak:15.1.1
Expand Down Expand Up @@ -64,6 +68,8 @@ services:
build:
context: .
dockerfile: ./local/portal/Dockerfile.E2E
secrets:
- npm_token
env_file:
- .env.local
ports:
Expand All @@ -80,6 +86,8 @@ services:
build:
context: ./feeds
dockerfile: Dockerfile
secrets:
- npm_token
env_file:
- ./local/feeds/.env.local
restart: on-failure
Expand Down Expand Up @@ -208,6 +216,8 @@ services:
build:
context: ./local/cypress-jwks-url
dockerfile: Dockerfile
secrets:
- npm_token
volumes:
- ./local/cypress-jwks-url:/src
command: npm start
Expand Down Expand Up @@ -237,6 +247,8 @@ services:
build:
context: .
dockerfile: e2e/Dockerfile
secrets:
- npm_token
volumes:
- ./e2e/coverage:/e2e/coverage
- ./e2e/results:/e2e/results
Expand Down
8 changes: 6 additions & 2 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM cypress/included:13.17.0
WORKDIR /app
COPY src/. ./

RUN npm install --legacy-peer-deps
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

Expand All @@ -14,7 +16,9 @@ WORKDIR /e2e
RUN apt-get -y update; apt-get -y install curl
COPY e2e/package.json /e2e
COPY e2e/package-lock.json /e2e
RUN npm install
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
Expand Down
4 changes: 3 additions & 1 deletion feeds/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ ENV APP_REVISION=${APP_REVISION}
WORKDIR /app

COPY package*.json ./
RUN npm install
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 . ./

Expand Down
4 changes: 3 additions & 1 deletion local/cypress-jwks-url/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ COPY package*.json /

EXPOSE 3500

RUN npm install
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 . /

Expand Down
6 changes: 5 additions & 1 deletion local/portal/Dockerfile.E2E
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ COPY --chown=node src/*.json ./

COPY --chown=node src/nyc.config.js ./

RUN npm install --legacy-peer-deps
USER root
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 && chown -R node:node /app
USER node

COPY --chown=node src ./

Expand Down
Loading