Compare commits

...

4 Commits

Author SHA1 Message Date
6275aaa326
Switched ci over to pnpm + cache
Some checks reported errors
continuous-integration/drone/pr Build was killed
continuous-integration/drone/push Build is failing
2023-03-29 19:56:05 +02:00
2a94bfa622
pinned pnpm version 2023-03-29 19:53:42 +02:00
a64f6c9822
COPY by stage name 2023-03-29 19:52:59 +02:00
93d43b7684
Switched dockerfile to pnpm 8 with cache 2023-03-29 19:52:31 +02:00
3 changed files with 28 additions and 20 deletions

View File

@ -26,6 +26,13 @@ get:
path: odit-ci-bot
name: apikey
---
kind: secret
name: npm_url
get:
path: odit-npm-cache
name: url
---
kind: pipeline
type: kubernetes
@ -41,8 +48,9 @@ steps:
- name: run tests
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
commands:
- yarn
- yarn test:ci
- npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8
- pnpm i
- pnpm test:ci
trigger:
event:
- pull_request
@ -69,10 +77,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/backend
tags:
- dev
@ -109,10 +115,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/backend
tags:
- latest
@ -149,10 +153,8 @@ steps:
password:
from_secret: docker_password
build_args:
- NPM_REGISTRY_DOMAIN:
from_secret: npmjs_domain
- NPM_REGISTRY_TOKEN:
from_secret: npmjs_token
- NPM_REGISTRY_URL:
from_secret: npm_url
repo: lfk/backend
tags:
- "${DRONE_TAG}"

View File

@ -1,15 +1,18 @@
# Typescript Build
FROM registry.odit.services/hub/library/node:19.5.0-alpine3.16
FROM registry.odit.services/hub/library/node:19.5.0-alpine3.16 as build
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
WORKDIR /app
COPY package.json ./
RUN npx pnpm@7.26.3 i
RUN npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8 && pnpm i
COPY tsconfig.json ormconfig.js ./
COPY src ./src
RUN npm run build
RUN pnpm build
# final image
FROM registry.odit.services/hub/library/node:19.5.0-alpine3.16
FROM registry.odit.services/hub/library/node:19.5.0-alpine3.16 as final
COPY package.json ormconfig.js ./
RUN npx pnpm@7.26.3 i --prod
COPY --from=0 /app/dist dist
COPY --from=build /app/dist dist
ENTRYPOINT ["node", "dist/app.js"]

View File

@ -3,6 +3,9 @@
"version": "0.14.3",
"main": "src/app.ts",
"repository": "https://git.odit.services/lfk/backend",
"engines": {
"pnpm": "8.0.0"
},
"author": {
"name": "ODIT.Services",
"email": "info@odit.services",
@ -111,4 +114,4 @@
"docs/*"
]
}
}
}