Compare commits
21 Commits
0.0.3
...
f3ff19098b
| Author | SHA1 | Date | |
|---|---|---|---|
|
f3ff19098b
|
|||
|
8bc852fa7d
|
|||
|
8e06b98695
|
|||
|
809255baa6
|
|||
|
21e80ca883
|
|||
|
cfb7c7e453
|
|||
|
82498e7714
|
|||
|
87a611459a
|
|||
|
0a09208766
|
|||
|
99ce364dc4
|
|||
|
2daa33f3ac
|
|||
|
2814c6820b
|
|||
|
d9cafe009d
|
|||
|
d011f15136
|
|||
|
ee398feeb9
|
|||
|
c2d9f8be5a
|
|||
|
5f69193b81
|
|||
|
2a13a433e1
|
|||
|
b094ae2c9a
|
|||
|
e48037a7d4
|
|||
|
ecfa12154d
|
268
.drone.yml
268
.drone.yml
@@ -1,70 +1,120 @@
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: Test Pipeline
|
||||
|
||||
# workspace:
|
||||
# path: /drone/grow
|
||||
|
||||
# steps:
|
||||
# - name: yarn install
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn install
|
||||
|
||||
# - name: Code Style Checks
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn prettier
|
||||
|
||||
# - name: Lint
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn lint
|
||||
|
||||
# - name: Unit Tests
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn test
|
||||
|
||||
# - name: Send Status Notification
|
||||
# image: plugins/webhook
|
||||
# settings:
|
||||
# urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
||||
# content_type: application/json
|
||||
# template: |
|
||||
# {
|
||||
# "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
# "text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
# "username":"DroneBot"
|
||||
# }
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
# - failure
|
||||
|
||||
# trigger:
|
||||
# event:
|
||||
# - push
|
||||
|
||||
# ---
|
||||
# kind: pipeline
|
||||
# type: docker
|
||||
# name: Build Pipeline
|
||||
|
||||
# workspace:
|
||||
# path: /drone/grow
|
||||
|
||||
# steps:
|
||||
# - name: yarn install
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn install
|
||||
|
||||
# - name: Build
|
||||
# image: node:latest
|
||||
# commands:
|
||||
# - yarn build
|
||||
|
||||
# - name: Send Status Notifications
|
||||
# image: plugins/webhook
|
||||
# settings:
|
||||
# urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
||||
# content_type: application/json
|
||||
# template: |
|
||||
# {
|
||||
# "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
# "text": "[{{ repo.name }} - Build # {{ build.number }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
# "username":"DroneBot"
|
||||
# }
|
||||
# when:
|
||||
# status:
|
||||
# - success
|
||||
# - failure
|
||||
|
||||
# depends_on:
|
||||
# - Test Pipeline
|
||||
|
||||
# trigger:
|
||||
# branch:
|
||||
# - main
|
||||
# event:
|
||||
# - push
|
||||
|
||||
# ---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Test Pipeline
|
||||
name: Publish Pipeline - NPM Package
|
||||
group: publish
|
||||
|
||||
workspace:
|
||||
path: /drone/grow
|
||||
|
||||
steps:
|
||||
- name: yarn install
|
||||
- name: Build Service
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn install
|
||||
|
||||
- name: Code Style Checks
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn prettier
|
||||
|
||||
- name: Lint
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn lint
|
||||
|
||||
- name: Unit Tests
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn test
|
||||
|
||||
- name: Send Status Notification
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
||||
content_type: application/json
|
||||
template: |
|
||||
{
|
||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
"text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
"username":"DroneBot"
|
||||
}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Build Pipeline
|
||||
|
||||
workspace:
|
||||
path: /drone/grow
|
||||
|
||||
steps:
|
||||
- name: yarn install
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn install
|
||||
|
||||
- name: Build
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn build
|
||||
|
||||
- name: Publish NPM
|
||||
image: plugins/npm
|
||||
settings:
|
||||
username:
|
||||
from_secret: regsitry_username
|
||||
password:
|
||||
from_secret: regsitry_password
|
||||
registry: git.mifi.dev
|
||||
token:
|
||||
- from_secret: gitea_token
|
||||
- name: Send Status Notifications
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
@@ -73,7 +123,7 @@ steps:
|
||||
template: |
|
||||
{
|
||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
"text": "[{{ repo.name }} - Build # {{ build.number }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
"text": "[{{ repo.name }} - New tagged docker image release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
"username":"DroneBot"
|
||||
}
|
||||
when:
|
||||
@@ -81,14 +131,78 @@ steps:
|
||||
- success
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- Test Pipeline
|
||||
# depends_on:
|
||||
# - Build Pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
# event:
|
||||
# - tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Publish Pipeline - Docker Image
|
||||
group: publish
|
||||
|
||||
workspace:
|
||||
path: /drone/grow
|
||||
|
||||
steps:
|
||||
- name: Build Service
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn install
|
||||
- yarn build
|
||||
- name: Publish Image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
auto_tag: true
|
||||
squash: true
|
||||
repo: git.mifi.dev/mifi/auth
|
||||
registry: git.mifi.dev
|
||||
username:
|
||||
from_secret: regsitry_username
|
||||
password:
|
||||
from_secret: regsitry_password
|
||||
ssh-agent-key:
|
||||
from_secret: gitea_token
|
||||
volumes:
|
||||
- name: dockersock
|
||||
Path: /var/run/docker.sock
|
||||
- name: dockerconfig
|
||||
Path: /.docker/config.json
|
||||
- name: Send Status Notifications
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
||||
content_type: application/json
|
||||
template: |
|
||||
{
|
||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
||||
"text": "[{{ repo.name }} - New tagged docker image release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||
"username":"DroneBot"
|
||||
}
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
- name: dockerconfig
|
||||
path: /volume1/docker/labs/grow-auth/dockerconfig.json
|
||||
|
||||
# depends_on:
|
||||
# - Build Pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
# event:
|
||||
# - tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -98,25 +212,23 @@ name: Deploy Pipeline
|
||||
workspace:
|
||||
path: /drone/grow
|
||||
|
||||
# image_pull_secrets:
|
||||
# - from_secret: gitea_token
|
||||
|
||||
steps:
|
||||
- name: Build Container
|
||||
image: node:latest
|
||||
commands:
|
||||
- cp /drone/grow/package.json ./
|
||||
- cp /drone/grow/yarn.lock ./
|
||||
- yarn install --frozen-lockfile
|
||||
- cp -r /drone/grow/* .
|
||||
- yarn build
|
||||
- name: Deploy Container
|
||||
image: docker
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
commands:
|
||||
- compose build .
|
||||
- compose up -d
|
||||
- docker compose build
|
||||
- docker compose up --wait
|
||||
volumes:
|
||||
- name: env
|
||||
path: ./.env
|
||||
- name: dockersock
|
||||
Path: /var/run/docker.sock
|
||||
- name: dockerconfig
|
||||
Path: ./.docker/config.json
|
||||
- name: Send Status Notifications
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
@@ -135,17 +247,17 @@ steps:
|
||||
|
||||
volumes:
|
||||
- name: env
|
||||
host:
|
||||
path: /volume1/docker/labs/grow-auth/.env
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
- name: dockerconfig
|
||||
path: /volume1/docker/labs/grow-auth/dockerconfig.json
|
||||
|
||||
depends_on:
|
||||
- Build Pipeline
|
||||
# depends_on:
|
||||
# - Build Pipeline
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
# event:
|
||||
# - tag
|
||||
|
||||
29
Dockerfile
29
Dockerfile
@@ -1,2 +1,27 @@
|
||||
FROM node
|
||||
CMD ["node", "dist/lib/server/index.js"]
|
||||
# FROM node:20-alpine AS build
|
||||
# RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
|
||||
# WORKDIR /home/node/app
|
||||
# COPY package*.json .
|
||||
# COPY dist/lib .
|
||||
# USER node
|
||||
# RUN yarn install --frozen-lockfile --production
|
||||
# COPY --chown=node:node node_modules ./node_modules
|
||||
# CMD ["node", "dist/lib/server/index.js"]
|
||||
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /home/node/app
|
||||
COPY package*.json ./
|
||||
COPY tsconfig.json ./
|
||||
COPY lib ./lib
|
||||
RUN ls -a
|
||||
RUN yarn install
|
||||
RUN yarn build:production
|
||||
|
||||
## this is stage two , where the app actually runs
|
||||
FROM node:20-alpine AS containerize
|
||||
WORKDIR /home/node/app
|
||||
COPY package*.json ./
|
||||
RUN yarn install --frozen-lockfile --production
|
||||
COPY --from=0 /home/node/app/dist .
|
||||
EXPOSE 80
|
||||
CMD ["node","server/index.js"]
|
||||
|
||||
@@ -12,7 +12,6 @@ services:
|
||||
- docknet
|
||||
volumes:
|
||||
- '/volume1/docker/labs/grow-auth/mongo:/data/db'
|
||||
# - '/var/tmp/grow/mongo:/data/db'
|
||||
restart: unless-stopped
|
||||
image: mongo
|
||||
auth-service:
|
||||
@@ -48,7 +47,6 @@ services:
|
||||
volumes:
|
||||
- '/Volume1/docker/.yarnrc.yml:/.yarnrc.yml'
|
||||
- '/Volume1/docker/labs/grow-auth/.env:/.env'
|
||||
# - '~/Projects/Grow/auth/.env:/.env'
|
||||
restart: unless-stopped
|
||||
image: node
|
||||
depends_on:
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "@mifi/auth",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.7",
|
||||
"author": "mifi (Mike Fitzpatrick)",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build:production": "tsc -p .",
|
||||
"format": "prettier:fix && lint:fix",
|
||||
"lint": "eslint --ext .ts,.tsx lib/",
|
||||
"lint:fix": "eslint --fix --ext .ts,.tsx lib/",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"noImplicitAny": true,
|
||||
"outDir": "./dist/",
|
||||
"rootDirs": ["lib", "../"],
|
||||
"rootDirs": ["lib"],
|
||||
"sourceMap": true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user