Compare commits
34 Commits
0.0.27
...
6bf7afbe09
| Author | SHA1 | Date | |
|---|---|---|---|
|
6bf7afbe09
|
|||
|
5c94dbbff5
|
|||
|
cb44eb1fab
|
|||
|
df63d7947f
|
|||
|
01a5ff907c
|
|||
|
e22e3d8bc3
|
|||
|
efecd78355
|
|||
|
ed4246ba0e
|
|||
|
4acc228fe3
|
|||
|
42279b0592
|
|||
|
e417ab64d8
|
|||
|
93b11c3a35
|
|||
|
1ef2c4919e
|
|||
|
6ff8f74317
|
|||
|
bf70ca98f3
|
|||
|
52e5befd93
|
|||
|
a047b49073
|
|||
|
59b20578bb
|
|||
|
cdd6c6a72a
|
|||
|
1d16473d2d
|
|||
|
cd2bef9811
|
|||
|
62118b6d64
|
|||
|
8290b332fb
|
|||
|
61236719f4
|
|||
|
aa699d5009
|
|||
|
9a4f9cdf4c
|
|||
|
5532fc51a9
|
|||
|
99db648a36
|
|||
|
adcab6afcb
|
|||
|
8e40c0a06c
|
|||
|
db5e4858b8
|
|||
|
d800311ae7
|
|||
|
32fdde5d90
|
|||
|
2eacdaeece
|
196
.drone.yml
196
.drone.yml
@@ -1,74 +1,73 @@
|
|||||||
kind: pipeline
|
# kind: pipeline
|
||||||
type: docker
|
# type: docker
|
||||||
name: Test Pipeline
|
# name: Test Pipeline
|
||||||
|
|
||||||
workspace:
|
# workspace:
|
||||||
path: /drone/grow
|
# path: /drone/grow
|
||||||
|
|
||||||
steps:
|
# steps:
|
||||||
- name: yarn install
|
# - name: yarn install
|
||||||
image: node:latest
|
# image: node:latest
|
||||||
commands:
|
# commands:
|
||||||
- yarn install
|
# - yarn install
|
||||||
- name: Code Style Checks
|
# - name: Code Style Checks
|
||||||
image: node:latest
|
# image: node:latest
|
||||||
commands:
|
# commands:
|
||||||
- yarn prettier
|
# - yarn prettier
|
||||||
- name: Lint
|
# - name: Lint
|
||||||
image: node:latest
|
# image: node:latest
|
||||||
commands:
|
# commands:
|
||||||
- yarn lint
|
# - yarn lint
|
||||||
- name: Unit Tests
|
# - name: Unit Tests
|
||||||
image: node:latest
|
# image: node:latest
|
||||||
commands:
|
# commands:
|
||||||
- yarn test
|
# - yarn test
|
||||||
- name: Send Test Status Notification
|
# - name: Send Test Status Notification
|
||||||
image: plugins/webhook
|
# image: plugins/webhook
|
||||||
settings:
|
# settings:
|
||||||
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
# urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
||||||
content_type: application/json
|
# content_type: application/json
|
||||||
template: |
|
# template: |
|
||||||
{
|
# {
|
||||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
# "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}}",
|
# "text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||||
"username":"DroneBot"
|
# "username":"DroneBot"
|
||||||
}
|
# }
|
||||||
when:
|
# when:
|
||||||
status:
|
# status:
|
||||||
- success
|
# - success
|
||||||
- failure
|
# - failure
|
||||||
- name: Build
|
# - name: Build
|
||||||
image: node:latest
|
# image: node:latest
|
||||||
commands:
|
# commands:
|
||||||
- yarn build
|
# - yarn build
|
||||||
- name: Send Build Status Notifications
|
# - name: Send Build Status Notifications
|
||||||
image: plugins/webhook
|
# image: plugins/webhook
|
||||||
settings:
|
# settings:
|
||||||
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
# urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
||||||
content_type: application/json
|
# content_type: application/json
|
||||||
template: |
|
# template: |
|
||||||
{
|
# {
|
||||||
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
# "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 }} - Build # {{ build.number }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
||||||
"username":"DroneBot"
|
# "username":"DroneBot"
|
||||||
}
|
# }
|
||||||
when:
|
# when:
|
||||||
status:
|
# status:
|
||||||
- success
|
# - success
|
||||||
- failure
|
# - failure
|
||||||
|
|
||||||
trigger:
|
# trigger:
|
||||||
branch:
|
# branch:
|
||||||
- main
|
# - main
|
||||||
event:
|
# event:
|
||||||
- pull_request
|
# # - pull_request
|
||||||
- push
|
# - push
|
||||||
|
|
||||||
---
|
# ---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: Publish Pipeline
|
name: Publish Pipeline
|
||||||
group: publish
|
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
path: /drone/grow
|
path: /drone/grow
|
||||||
@@ -80,19 +79,27 @@ steps:
|
|||||||
- yarn install
|
- yarn install
|
||||||
- yarn build
|
- yarn build
|
||||||
- name: Publish NPM
|
- name: Publish NPM
|
||||||
image: plugins/npm
|
image: node:latest
|
||||||
failure: ignore
|
failure: ignore
|
||||||
settings:
|
commands:
|
||||||
username:
|
- yarn npm publish
|
||||||
from_secret: registry_username
|
|
||||||
password:
|
|
||||||
from_secret: registry_password
|
|
||||||
registry: https://git.mifi.dev/api/packages/mifi/npm
|
|
||||||
token:
|
|
||||||
- from_secret: gitea_token
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: npmrc
|
- name: npmrc
|
||||||
path: /drone/grow/.npmrc
|
path: /drone/grow/.npmrc
|
||||||
|
# - name: Publish NPM
|
||||||
|
# image: plugins/npm
|
||||||
|
# failure: ignore
|
||||||
|
# settings:
|
||||||
|
# username:
|
||||||
|
# from_secret: registry_username
|
||||||
|
# password:
|
||||||
|
# from_secret: registry_password
|
||||||
|
# registry: https://git.mifi.dev/api/packages/mifi/npm
|
||||||
|
# token:
|
||||||
|
# - from_secret: gitea_token
|
||||||
|
# volumes:
|
||||||
|
# - name: npmrc
|
||||||
|
# path: /drone/grow/.npmrc
|
||||||
- name: Report NPM Publish Status
|
- name: Report NPM Publish Status
|
||||||
image: plugins/webhook
|
image: plugins/webhook
|
||||||
settings:
|
settings:
|
||||||
@@ -111,32 +118,14 @@ steps:
|
|||||||
- name: Publish Image
|
- name: Publish Image
|
||||||
image: docker
|
image: docker
|
||||||
commands:
|
commands:
|
||||||
- docker build -f docker-compose.staging.yml -t git.mifi.dev/mifi/mifi/auth:latest .
|
# - 'docker login git.mifi.dev'
|
||||||
|
- 'docker build -t git.mifi.dev/mifi/mifi/auth:latest -t git.mifi.dev/mifi/mifi/auth:${DRONE_TAG} .'
|
||||||
- docker push git.mifi.dev/mifi/mifi/auth:latest
|
- docker push git.mifi.dev/mifi/mifi/auth:latest
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
- name: dockerconfig
|
- name: dockerconfig
|
||||||
path: /drone/grow/.docker/config.json
|
path: /drone/grow/.docker/config.json
|
||||||
# - name: Publish Image
|
|
||||||
# image: plugins/docker
|
|
||||||
# settings:
|
|
||||||
# auto_tag: true
|
|
||||||
# squash: true
|
|
||||||
# repo: git.mifi.dev/mifi/auth
|
|
||||||
# context: mifi
|
|
||||||
# registry: git.mifi.dev
|
|
||||||
# username:
|
|
||||||
# from_secret: registry_username
|
|
||||||
# password:
|
|
||||||
# from_secret: registry_password
|
|
||||||
# ssh-agent-key:
|
|
||||||
# from_secret: gitea_token
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
- name: dockerconfig
|
|
||||||
path: /drone/grow/.docker/config.json
|
|
||||||
- name: Report Image Publish Status
|
- name: Report Image Publish Status
|
||||||
image: plugins/webhook
|
image: plugins/webhook
|
||||||
settings:
|
settings:
|
||||||
@@ -164,15 +153,15 @@ volumes:
|
|||||||
host:
|
host:
|
||||||
path: /volume1/docker/beethoven/labs-auth/.npmrc
|
path: /volume1/docker/beethoven/labs-auth/.npmrc
|
||||||
|
|
||||||
depends_on:
|
# depends_on:
|
||||||
- Test Pipeline
|
# - Test Pipeline
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
# - tag
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -186,13 +175,18 @@ steps:
|
|||||||
- name: Deploy Container
|
- name: Deploy Container
|
||||||
image: docker
|
image: docker
|
||||||
privileged: true
|
privileged: true
|
||||||
|
environment:
|
||||||
|
CONTAINER_PREFIX: staging
|
||||||
|
HOST: area51.mifi.dev
|
||||||
|
ROUTE_PREFIX: /auth
|
||||||
|
PORT: 9001
|
||||||
commands:
|
commands:
|
||||||
- docker compose -f docker-compose.staging.yml pull
|
- docker compose -f docker-compose.staging.yml pull
|
||||||
- docker compose -f docker-compose.staging.yml build --no-cache
|
- docker compose -f docker-compose.staging.yml build --no-cache
|
||||||
- docker compose -f docker-compose.staging.yml rm --stop
|
- docker compose -f docker-compose.staging.yml rm --stop
|
||||||
- docker compose -f docker-compose.staging.yml up --wait
|
- docker compose -f docker-compose.staging.yml up --wait
|
||||||
volumes:
|
volumes:
|
||||||
- name: env
|
- name: env-secrets
|
||||||
path: /drone/grow/staging.env
|
path: /drone/grow/staging.env
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
@@ -222,16 +216,16 @@ volumes:
|
|||||||
- name: dockersock
|
- name: dockersock
|
||||||
host:
|
host:
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
- name: env
|
- name: env-secrets
|
||||||
host:
|
host:
|
||||||
path: /volume1/docker/beethoven/labs-auth/staging.env
|
path: /volume1/docker/beethoven/labs-auth/staging.env
|
||||||
|
|
||||||
depends_on:
|
# depends_on:
|
||||||
- Test Pipeline
|
# - Test Pipeline
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
# - tag
|
||||||
|
|||||||
@@ -27,5 +27,3 @@ RESET_VALID_MINUTES=15
|
|||||||
DEFAULT_TOKEN_DAYS=1
|
DEFAULT_TOKEN_DAYS=1
|
||||||
|
|
||||||
CONTAINER_PREFIX=dev
|
CONTAINER_PREFIX=dev
|
||||||
SERVICE_NAME=auth-service
|
|
||||||
DB_TYPE=mongo
|
|
||||||
10
Dockerfile
10
Dockerfile
@@ -1,13 +1,3 @@
|
|||||||
# 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
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
auth-service_mongo:
|
auth-service_mongo:
|
||||||
env_file: dev.env
|
env_file: .env.dev
|
||||||
|
build:
|
||||||
|
args:
|
||||||
|
- CONTAINER_PREFIX=${CONTAINER_PREFIX}
|
||||||
container_name: ${CONTAINER_PREFIX:-dev}-auth-service_mongo
|
container_name: ${CONTAINER_PREFIX:-dev}-auth-service_mongo
|
||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 27017:27017
|
||||||
@@ -14,8 +17,14 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: mongo:latest
|
image: mongo:latest
|
||||||
auth-service:
|
auth-service:
|
||||||
env_file: dev.env
|
env_file: .env.dev
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
- HOST=${HOST}
|
||||||
|
- PORT=${PORT}
|
||||||
|
- ROUTE_PREFIX=${ROUTE_PREFIX}
|
||||||
|
- CONTAINER_PREFIX=${CONTAINER_PREFIX}
|
||||||
container_name: ${CONTAINER_PREFIX:-dev}-auth-service
|
container_name: ${CONTAINER_PREFIX:-dev}-auth-service
|
||||||
ports:
|
ports:
|
||||||
- 9001:9001
|
- 9001:9001
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
auth-service_mongo:
|
auth-service_mongo:
|
||||||
container_name: ${CONTAINER_PREFIX:-mifi}-auth-service_mongo
|
container_name: ${CONTAINER_PREFIX}-auth-service_mongo
|
||||||
env_file: staging.env
|
env_file:
|
||||||
|
- staging.env
|
||||||
networks:
|
networks:
|
||||||
- docknet
|
- docknet
|
||||||
volumes:
|
volumes:
|
||||||
@@ -11,9 +12,10 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: mongo:latest
|
image: mongo:latest
|
||||||
auth-service:
|
auth-service:
|
||||||
env_file: staging.env
|
env_file:
|
||||||
|
- staging.env
|
||||||
build: .
|
build: .
|
||||||
container_name: ${CONTAINER_PREFIX:-mifi}-auth-service
|
container_name: ${CONTAINER_PREFIX}-auth-service
|
||||||
environment:
|
environment:
|
||||||
- DB_HOST=${CONTAINER_PREFIX:-mifi}-auth-service_mongo
|
- DB_HOST=${CONTAINER_PREFIX:-mifi}-auth-service_mongo
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mifi/auth",
|
"name": "@mifi/auth",
|
||||||
"version": "0.0.27",
|
"version": "0.0.34",
|
||||||
"author": "mifi (Mike Fitzpatrick)",
|
"author": "mifi (Mike Fitzpatrick)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user