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
|
path: odit-ci-bot
|
||||||
name: apikey
|
name: apikey
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: secret
|
||||||
|
name: npm_url
|
||||||
|
get:
|
||||||
|
path: odit-npm-cache
|
||||||
|
name: url
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
@ -41,8 +48,9 @@ steps:
|
|||||||
- name: run tests
|
- name: run tests
|
||||||
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
|
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8
|
||||||
- yarn test:ci
|
- pnpm i
|
||||||
|
- pnpm test:ci
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- pull_request
|
- pull_request
|
||||||
@ -69,10 +77,8 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
build_args:
|
build_args:
|
||||||
- NPM_REGISTRY_DOMAIN:
|
- NPM_REGISTRY_URL:
|
||||||
from_secret: npmjs_domain
|
from_secret: npm_url
|
||||||
- NPM_REGISTRY_TOKEN:
|
|
||||||
from_secret: npmjs_token
|
|
||||||
repo: lfk/backend
|
repo: lfk/backend
|
||||||
tags:
|
tags:
|
||||||
- dev
|
- dev
|
||||||
@ -109,10 +115,8 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
build_args:
|
build_args:
|
||||||
- NPM_REGISTRY_DOMAIN:
|
- NPM_REGISTRY_URL:
|
||||||
from_secret: npmjs_domain
|
from_secret: npm_url
|
||||||
- NPM_REGISTRY_TOKEN:
|
|
||||||
from_secret: npmjs_token
|
|
||||||
repo: lfk/backend
|
repo: lfk/backend
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
@ -149,10 +153,8 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
build_args:
|
build_args:
|
||||||
- NPM_REGISTRY_DOMAIN:
|
- NPM_REGISTRY_URL:
|
||||||
from_secret: npmjs_domain
|
from_secret: npm_url
|
||||||
- NPM_REGISTRY_TOKEN:
|
|
||||||
from_secret: npmjs_token
|
|
||||||
repo: lfk/backend
|
repo: lfk/backend
|
||||||
tags:
|
tags:
|
||||||
- "${DRONE_TAG}"
|
- "${DRONE_TAG}"
|
||||||
|
13
Dockerfile
13
Dockerfile
@ -1,15 +1,18 @@
|
|||||||
# Typescript Build
|
# 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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
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 tsconfig.json ormconfig.js ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN npm run build
|
RUN pnpm build
|
||||||
|
|
||||||
# final image
|
# 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 ./
|
COPY package.json ormconfig.js ./
|
||||||
RUN npx pnpm@7.26.3 i --prod
|
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"]
|
ENTRYPOINT ["node", "dist/app.js"]
|
@ -3,6 +3,9 @@
|
|||||||
"version": "0.14.3",
|
"version": "0.14.3",
|
||||||
"main": "src/app.ts",
|
"main": "src/app.ts",
|
||||||
"repository": "https://git.odit.services/lfk/backend",
|
"repository": "https://git.odit.services/lfk/backend",
|
||||||
|
"engines": {
|
||||||
|
"pnpm": "8.0.0"
|
||||||
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"name": "ODIT.Services",
|
"name": "ODIT.Services",
|
||||||
"email": "info@odit.services",
|
"email": "info@odit.services",
|
||||||
@ -111,4 +114,4 @@
|
|||||||
"docs/*"
|
"docs/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user