-
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.
Merge pull request #22 from meta-panic/build/run-tests-frontend-deploy
[bruno]Build/run tests frontend deploy
- Loading branch information
Showing
11 changed files
with
194 additions
and
435 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
2 changes: 1 addition & 1 deletion
2
cms/tests/bruno-cms-collection/environments/local-environment.bru
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,3 +1,3 @@ | ||
vars { | ||
baseStrapiAdminUrl: http://localhost:1337 | ||
baseStrapiAdminUrl: http://127.0.0.1:1337 | ||
} |
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 |
---|---|---|
|
@@ -4,8 +4,13 @@ FROM node:18-alpine | |
|
||
WORKDIR /app | ||
|
||
# Install bash and curl | ||
RUN apk add --no-cache bash 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/[email protected] | ||
|
||
RUN \ | ||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ | ||
elif [ -f package-lock.json ]; then npm ci; \ | ||
|
@@ -18,6 +23,9 @@ 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 | ||
|
@@ -26,9 +34,9 @@ COPY tsconfig.json . | |
# Note: Don't expose ports here, Compose will handle that for us | ||
|
||
# Start Next.js in development mode based on the preferred package manager | ||
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 | ||
|
||
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" |
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 |
---|---|---|
|
@@ -29,7 +29,8 @@ 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 | ||
RUN apk add --no-cache bash curl | ||
RUN npm install -g @usebruno/[email protected] | ||
|
||
# Uncomment the following line in case you want to disable telemetry during runtime. | ||
# ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
@@ -44,8 +45,15 @@ 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 ["node", "server.js"] | ||
CMD bash -c "./run-tests.sh docker & ./run.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
Oops, something went wrong.