Skip to content
Open
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
1,778 changes: 129 additions & 1,649 deletions cms/package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"description": "A Strapi application",
"scripts": {
"build": "strapi build",
"bru-local": "cd tests/bruno-cms-collection/ && bru run --env local-environment",
"bru-prod": "cd tests/bruno-cms-collection/ && bru run --env prod-environment",
"deploy": "strapi deploy",
"develop": "strapi develop",
"develop:watch": "npm run develop -- --watch-admin",
Expand All @@ -21,7 +19,6 @@
"@strapi/plugin-graphql": "^5.8.1",
"@strapi/plugin-users-permissions": "5.1.0",
"@strapi/strapi": "5.1.0",
"@usebruno/cli": "^1.36.3",
"cheerio": "^1.0.0",
"fs-extra": "^10.1.0",
"mime": "^2.6.0",
Expand All @@ -33,7 +30,6 @@
"styled-components": "^6.0.0"
},
"devDependencies": {
"@playwright/test": "^1.49.1",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20",
"@types/react": "^18",
Expand Down
57 changes: 0 additions & 57 deletions cms/run-tests.sh

This file was deleted.

3 changes: 0 additions & 3 deletions cms/tests/bruno-cms-collection/.env.example

This file was deleted.

46 changes: 0 additions & 46 deletions cms/tests/playwright/baseTest.ts

This file was deleted.

2 changes: 1 addition & 1 deletion dev-config/Dockerfile.cms
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ RUN echo "ls -la"
RUN ls -la /usr/app

RUN bash -c "chmod 777 run.sh;"
CMD bash -c "./run-tests.sh docker & ./run.sh"
CMD bash -c "./run.sh"
13 changes: 7 additions & 6 deletions dev-config/Dockerfile.frontend.dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ FROM node:18-alpine
WORKDIR /app

# Install bash and curl
RUN apk add --no-cache bash curl
RUN apk add --no-cache bash

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl больше не нужен?


# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN npm install -g @usebruno/cli@1.38.1

RUN npm ci --include=optional sharp

Expand All @@ -23,9 +22,7 @@ COPY src ./src
COPY public ./public
COPY next.config.ts .
COPY tsconfig.json .
COPY tests ./tests
COPY run.sh ./
COPY run-tests.sh ./

# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry
# Uncomment the following line to disable telemetry at run time
Expand All @@ -36,7 +33,11 @@ COPY run-tests.sh ./
# Start Next.js in development mode based on the preferred package manager

RUN chmod +x ./run.sh
RUN chmod +x ./run-tests.sh

# Start Next.js in development mode after running tests
CMD bash -c "./run-tests.sh docker & ./run.sh"
CMD \
if [ -f yarn.lock ]; then yarn dev; \
elif [ -f package-lock.json ]; then npm run dev; \
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \
else npm run dev; \
fi
8 changes: 2 additions & 6 deletions dev-config/Dockerfile.frontend.prod
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ RUN npm run build
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
RUN apk add --no-cache bash curl
RUN npm install -g @usebruno/cli@1.38.1
RUN apk add --no-cache bash

# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED=1
Expand All @@ -53,15 +52,12 @@ COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

COPY tests ./tests
COPY run.sh ./
COPY run-tests.sh ./

RUN chmod +x ./run.sh
RUN chmod +x ./run-tests.sh

USER nextjs

RUN ls -la /app

CMD bash -c "./run-tests.sh docker & ./run.sh"
CMD ["node", "server.js"]
31 changes: 31 additions & 0 deletions dev-config/Dockerfile.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:18

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему не node:18-alpine?


WORKDIR /tests

# For temp files e.g. test-reports
RUN mkdir -p /tests/tmp

COPY package*.json ./

RUN echo "ls -la"
RUN ls -la /tests
RUN echo "COPY . ."
COPY . .

# Add a step to remove node_modules if it was accidentally copied
RUN echo "rm -rf node_*****modules"
RUN rm -rf node_modules

RUN echo "ls -la"
RUN ls -la /tests
RUN npm ci

RUN npm install -g @usebruno/cli@1.38.3
# install only chrome for now to reduce image size
RUN npx npx playwright install --only-shell --with-deps chromium

RUN echo "ls -la"
RUN ls -la /tests

RUN bash -c "chmod +x run-tests.sh;"
CMD bash -c "./run-tests.sh docker"
13 changes: 12 additions & 1 deletion dev-config/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,18 @@ services:
- db:/var/lib/postgresql/data
networks:
- strapi

tests:
tty: true
build:
context: ../tests
dockerfile: ../dev-config/Dockerfile.tests
environment:
NODE_ENV: ${NODE_ENV}
PROD_FRONT_URL: ${PROD_FRONT_URL}
PROD_STRAPI_URL: ${PROD_STRAPI_URL}
networks:
- strapi

networks:
strapi:
volumes:
Expand Down
10 changes: 6 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"bru-local": "cd tests/bruno-frontend-collection/ && bru run --env local-environment",
"bru-prod": "cd tests/bruno-frontend-collection/ && bru run --env prod-environment",
"gen:be-types": "graphql-codegen"
},
"dependencies": {
Expand All @@ -27,7 +25,6 @@
"@graphql-codegen/cli": "^5.0.3",
"@graphql-codegen/typescript": "^4.1.2",
"@graphql-codegen/typescript-resolvers": "^4.4.1",
"@playwright/test": "^1.49.1",
"@strapi/types": "^5.8.0",
"@strapi/utils": "^5.8.1",
"@svgr/webpack": "^8.1.0",
Expand All @@ -39,4 +36,4 @@
"eslint-config-next": "15.1.3",
"typescript": "^5"
}
}
}
Loading