Skip to content
Snippets Groups Projects
Unverified Commit 492f6ab6 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

ci: merge build and lint steps

parent 0f6864e3
No related branches found
No related tags found
1 merge request!89feat: did svdx integration OP#248
Pipeline #74271 passed
FROM node:18.19.1 as base FROM node:18.19.1 AS base
RUN apt update -y && apt install yarn python3 make build-essential -y RUN apt update -y && apt install yarn python3 make build-essential -y
FROM base as deps FROM base AS deps
WORKDIR /app WORKDIR /app
COPY package.json . COPY package.json .
...@@ -9,30 +9,17 @@ COPY yarn.lock . ...@@ -9,30 +9,17 @@ COPY yarn.lock .
RUN yarn install --frozen-lockfile RUN yarn install --frozen-lockfile
FROM base as linter FROM base AS builder
#TODO: pass MR title and validate it
RUN apt update -y && apt install yarn python3 make build-essential -y
WORKDIR /app WORKDIR /app
COPY . . COPY . .
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
RUN npx nx run-many --target=lint --projects=agent --configuration=production RUN npx nx run-many --target=lint --projects=agent --configuration=production
RUN npx nx run-many --target=test --projects=agent --configuration=production RUN npx nx run-many --target=test --projects=agent --configuration=production
RUN npx nx run-many --target=build --projects=agent --configuration=production
FROM base as builder FROM node:18.19.1-buster-slim AS production
RUN apt update -y && apt install yarn python3 make build-essential -y
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn nx run-many --target=build --projects=agent --configuration=production
FROM node:18.19.1-buster-slim as production
ENV NODE_ENV production ENV NODE_ENV production
...@@ -40,7 +27,6 @@ RUN apt update -y && apt install yarn python3 make build-essential -y ...@@ -40,7 +27,6 @@ RUN apt update -y && apt install yarn python3 make build-essential -y
WORKDIR /app WORKDIR /app
#copy from build
COPY --from=builder /app/dist . COPY --from=builder /app/dist .
COPY --from=builder /app/dist/apps/agent/package.json . COPY --from=builder /app/dist/apps/agent/package.json .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment