mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge pull request #187 from Tria-plc/alpha
fix: add lockfile corruption handling to CI/CD and Dockerfiles
This commit is contained in:
8
.github/workflows/deploy.yml
vendored
8
.github/workflows/deploy.yml
vendored
@@ -146,6 +146,14 @@ jobs:
|
|||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
run: ./scripts/deploy/create-npmrc.sh
|
run: ./scripts/deploy/create-npmrc.sh
|
||||||
|
|
||||||
|
- name: Fix lockfile if needed
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if ! pnpm install --frozen-lockfile 2>/dev/null; then
|
||||||
|
echo "Lockfile corrupted, regenerating..."
|
||||||
|
pnpm install --no-frozen-lockfile
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build ${{ matrix.service }}
|
- name: Build ${{ matrix.service }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ FROM base AS installer
|
|||||||
COPY --from=pruner /app/out/json/ .
|
COPY --from=pruner /app/out/json/ .
|
||||||
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||||
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
COPY --from=installer /app/ .
|
COPY --from=installer /app/ .
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ COPY --from=pruner /app/out/json/ .
|
|||||||
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||||
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
||||||
--mount=type=cache,id=pnpm,target=/pnpm/store \
|
--mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
COPY --from=installer /app/ .
|
COPY --from=installer /app/ .
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ FROM base AS installer
|
|||||||
COPY --from=pruner /app/out/json/ .
|
COPY --from=pruner /app/out/json/ .
|
||||||
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||||
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
COPY --from=installer /app/ .
|
COPY --from=installer /app/ .
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ COPY --from=pruner /app/out/json/ .
|
|||||||
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||||
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
RUN --mount=type=secret,id=npmrc,target=./.npmrc,required=false \
|
||||||
--mount=type=cache,id=pnpm,target=/pnpm/store \
|
--mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
ARG TURBO_FILTER
|
ARG TURBO_FILTER
|
||||||
|
|||||||
Reference in New Issue
Block a user