29 Commits

Author SHA1 Message Date
efecd78355 Publishing FTW
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 15:15:50 -04:00
ed4246ba0e testing secrets...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 15:08:49 -04:00
4acc228fe3 This one seems to be valid
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 14:57:15 -04:00
42279b0592 This. 2023-05-08 14:52:26 -04:00
e417ab64d8 Ah ha! Finally.
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 14:22:19 -04:00
93b11c3a35 Fallback to old working
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-08 14:07:40 -04:00
1ef2c4919e Maybe these odd changes?
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-07 00:57:46 -04:00
6ff8f74317 Or this?
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-07 00:55:59 -04:00
bf70ca98f3 Or this...
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-07 00:54:41 -04:00
52e5befd93 Doubtful...
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-07 00:53:29 -04:00
a047b49073 Last try, then pack 2023-05-06 10:18:39 -04:00
59b20578bb Maybe
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 10:15:03 -04:00
cdd6c6a72a Dammit
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 10:12:30 -04:00
1d16473d2d Ah ha!
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 10:10:02 -04:00
cd2bef9811 So broken...
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 10:00:17 -04:00
62118b6d64 ERGGGGG
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:57:46 -04:00
8290b332fb Ugh
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:56:00 -04:00
61236719f4 Or this...
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:55:09 -04:00
aa699d5009 Testing this... 2023-05-06 09:48:31 -04:00
9a4f9cdf4c Hmmm 2023-05-06 09:48:00 -04:00
5532fc51a9 Unbroken? 2023-05-06 09:45:05 -04:00
99db648a36 - Endlessly fighting the ENV - I should be loading from the package... 2023-05-06 09:40:25 -04:00
adcab6afcb Double dollar
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:28:24 -04:00
8e40c0a06c Tweaking the ENV
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:19:31 -04:00
db5e4858b8 More ENV updates
Some checks failed
continuous-integration/drone/push Build was killed
2023-05-06 09:10:45 -04:00
d800311ae7 - ENV updates
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 09:08:15 -04:00
32fdde5d90 - The missing env variables...
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 08:43:26 -04:00
2eacdaeece Tweaks
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-06 01:38:00 -04:00
827bce6e1b Updates for staging
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-06 01:15:11 -04:00
6 changed files with 153 additions and 165 deletions

View File

@@ -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
@@ -110,33 +109,20 @@ steps:
- failure - failure
- name: Publish Image - name: Publish Image
image: docker image: docker
environemnt:
USERNAME: 'mifi'
# from_secret: registry_username
PASSWORD: '%0z&+V5?A6PytCp8#4Z17-T}chQ9s{Lj'
# from_secret: registry_password
commands: commands:
- docker build -f docker-compose.staging.yml -t git.mifi.dev/mifi/mifi/auth:latest . - 'docker login -u ${USERNAME} -p ${PASSWORD} 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,74 +150,79 @@ 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
type: docker # type: docker
name: Deploy Pipeline # name: Deploy Pipeline
workspace: # workspace:
path: /drone/grow # path: /drone/grow
steps: # steps:
- name: Deploy Container # - name: Deploy Container
image: docker # image: docker
privileged: true # privileged: true
commands: # environment:
- docker compose -f docker-compose.staging.yml pull # CONTAINER_PREFIX: dev
- docker compose -f docker-compose.staging.yml build --no-cache # HOST: area51.mifi.dev
- docker compose -f docker-compose.staging.yml rm --stop # ROUTE_PREFIX: /auth
- docker compose -f docker-compose.staging.yml up --wait # PORT: 9001
volumes: # commands:
- name: env # - docker compose -f docker-compose.staging.yml pull
path: /drone/grow/.env # - docker compose -f docker-compose.staging.yml build --no-cache
- name: dockersock # - docker compose -f docker-compose.staging.yml rm --stop
path: /var/run/docker.sock # - docker compose -f docker-compose.staging.yml up --wait
- name: dockerconfig # volumes:
path: /drone/grow/.docker/config.json # - name: env-secrets
- name: Send Status Notifications # path: /drone/grow/staging.env
image: plugins/webhook # - name: dockersock
privileged: true # path: /var/run/docker.sock
settings: # - name: dockerconfig
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r # path: /drone/grow/.docker/config.json
content_type: application/json # - name: Send Status Notifications
template: | # image: plugins/webhook
{ # privileged: true
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png", # settings:
"text": "[{{ repo.name }} - Build # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}", # urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
"username":"DroneBot" # content_type: application/json
} # template: |
when: # {
status: # "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
- success # "text": "[{{ repo.name }} - Build # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
- failure # "username":"DroneBot"
# }
# when:
# status:
# - success
# - failure
volumes: # volumes:
- name: dockerconfig # - name: dockerconfig
host: # host:
path: /volume1/docker/dockerconfig.json # path: /volume1/docker/dockerconfig.json
- 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

View File

@@ -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

View File

@@ -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 ./

View File

@@ -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

View File

@@ -3,19 +3,19 @@ version: '3.8'
services: services:
auth-service_mongo: auth-service_mongo:
container_name: ${CONTAINER_PREFIX}-auth-service_mongo container_name: ${CONTAINER_PREFIX}-auth-service_mongo
env_file: .env env_file:
- staging.env
networks: networks:
- docknet - docknet
volumes: volumes:
- '/volume1/docker/labs/auth/mongo:/data/db' - '/volume1/docker/labs/auth/mongo:/data/db'
restart: unless-stopped restart: unless-stopped
image: mongo image: mongo:latest
auth-service: auth-service:
env_file: .env env_file:
- staging.env
build: . build: .
container_name: ${CONTAINER_PREFIX}-auth-service container_name: ${CONTAINER_PREFIX}-auth-service
environment:
- DB_HOST=${CONTAINER_PREFIX}-auth-service_mongo
labels: labels:
- 'traefik.enable=true' - 'traefik.enable=true'
- 'traefik.http.routers.grow.rule=Host(`${HOST}`) && Path(`${ROUTE_PREFIX}`)' - 'traefik.http.routers.grow.rule=Host(`${HOST}`) && Path(`${ROUTE_PREFIX}`)'
@@ -27,7 +27,7 @@ services:
networks: networks:
- docknet - docknet
restart: unless-stopped restart: unless-stopped
image: node image: node:20-alpine
depends_on: depends_on:
- auth-service_mongo - auth-service_mongo
networks: networks:

View File

@@ -1,6 +1,6 @@
{ {
"name": "@mifi/auth", "name": "@mifi/auth",
"version": "0.0.26", "version": "0.0.34",
"author": "mifi (Mike Fitzpatrick)", "author": "mifi (Mike Fitzpatrick)",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {