Compare commits

..

4 Commits

Author SHA1 Message Date
f92ef51b76
Switched ci over to pnpm cache
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-29 20:26:51 +02:00
8e86f2db31
Switched dockerfile to more reasonable building + pnpm + cache 2023-03-29 20:24:14 +02:00
6d607570af
Dont ignore pnpm lock 2023-03-29 20:23:38 +02:00
aa5a0ec836
Pinned pnpm 2023-03-29 20:23:03 +02:00
5 changed files with 6674 additions and 35 deletions

View File

@ -14,10 +14,10 @@ get:
--- ---
kind: secret kind: secret
name: git_ssh name: npm_url
get: get:
path: odit-git-bot path: odit-npm-cache
name: sshkey name: url
--- ---
kind: pipeline kind: pipeline
@ -34,8 +34,12 @@ steps:
- name: run tests - name: run tests
image: registry.odit.services/hub/library/node:19.0.1-alpine3.16 image: registry.odit.services/hub/library/node:19.0.1-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
environment:
NPM_REGISTRY_URL:
from_secret: npm_url
trigger: trigger:
event: event:
- pull_request - pull_request
@ -61,10 +65,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/mailer repo: lfk/mailer
tags: tags:
- dev - dev
@ -84,13 +86,6 @@ clone:
disable: true disable: true
steps: steps:
- name: clone
image: alpine/git
commands:
- git clone $DRONE_REMOTE_URL .
- git checkout dev
- git merge main
- git checkout main
- name: build latest - name: build latest
image: registry.odit.services/library/drone-kaniko image: registry.odit.services/library/drone-kaniko
settings: settings:
@ -99,10 +94,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/mailer repo: lfk/mailer
tags: tags:
- latest - latest
@ -128,10 +121,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/mailer repo: lfk/mailer
tags: tags:
- "${DRONE_TAG}" - "${DRONE_TAG}"

1
.gitignore vendored
View File

@ -138,4 +138,3 @@ build
lib lib
/oss-attribution /oss-attribution
*.tmp *.tmp
pnpm-lock.yaml

View File

@ -1,16 +1,20 @@
# Typescript Build # Typescript Build
FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16 FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16 as build
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY package.json ./
RUN npm i -g pnpm RUN npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8
RUN pnpm i RUN mkdir /pnpm && pnpm config set store-dir /pnpm && pnpm i
COPY tsconfig.json ./ COPY tsconfig.json ./
COPY src ./src COPY src ./src
RUN pnpm run build RUN pnpm run build \
&& rm -rf /app/node_modules \
&& pnpm i --production --prefer-offline
# final image # final image
FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16 FROM registry.odit.services/hub/library/node:19.0.1-alpine3.16
COPY package.json ./ COPY --from=build /app/dist dist
RUN npm i -g pnpm COPY --from=build /app/node_modules /app/node_modules
RUN pnpm i --prod
COPY --from=0 /app/dist dist
ENTRYPOINT ["node", "dist/app.js"] ENTRYPOINT ["node", "dist/app.js"]

View File

@ -95,5 +95,8 @@
"hooks": { "hooks": {
"after:bump": "npm run changelog:export && npm run licenses:export && git add CHANGELOG.md && git add licenses.md" "after:bump": "npm run changelog:export && npm run licenses:export && git add CHANGELOG.md && git add licenses.md"
} }
},
"engines": {
"pnpm": "8.0.0"
} }
} }

6642
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff