Compare commits
4 Commits
16ce0a8480
...
6275aaa326
Author | SHA1 | Date | |
---|---|---|---|
6275aaa326 | |||
2a94bfa622 | |||
a64f6c9822 | |||
93d43b7684 |
30
.drone.yml
30
.drone.yml
@ -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}"
|
||||
|
13
Dockerfile
13
Dockerfile
@ -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"]
|
@ -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/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user