31 Commits

Author SHA1 Message Date
fbc1e55e5c Merge branch 'main' of ssh://git.mifi.dev:12022/mifi/auth 2023-05-09 19:15:25 -04:00
653fc7d52f promnotions 2023-05-09 19:15:01 -04:00
84881edb61 promnotions 2023-05-09 19:14:04 -04:00
c8b1b72694 New pipeline eventing 2023-05-09 19:08:17 -04:00
73cd1d794a Finalized drone pipeline (mostly)
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 18:52:31 -04:00
28ac23d8f2 Or one more...
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 18:30:26 -04:00
71b7519a53 Last try then go with what works
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 18:28:53 -04:00
28ee1a9d1e One works... but the other...
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 18:27:49 -04:00
f327c6e06e revert
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 18:18:14 -04:00
799ff00f9c Update pipeline. Again. Day 900 and something.
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-09 09:17:36 -04:00
369e3f4b5c !! 2023-05-08 19:26:53 -04:00
3788de2609 ??
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-08 19:24:42 -04:00
0f9aafe418 ........
Some checks failed
continuous-integration/drone/push Build encountered an error
2023-05-08 19:15:07 -04:00
13b90e9ee6 .....
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 19:13:44 -04:00
6e19a6217d Go!
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-08 19:08:55 -04:00
34fd4e7304 ...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 19:05:41 -04:00
5e04012aa4 Zoom!
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 18:59:13 -04:00
e8f2928543 Go!
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 18:53:26 -04:00
91a3b2fabf Do just one thing...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 18:40:38 -04:00
964b9a03ef New pipeline...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 18:31:24 -04:00
bf693645d4 Lordy...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 18:22:37 -04:00
082b4826c2 image_pull_secrets
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 16:59:12 -04:00
e68c3002d8 And again...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 16:37:43 -04:00
30d2f4a644 Go!
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 16:32:52 -04:00
875a45f2b8 Perchance to dream...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 16:18:00 -04:00
6bf7afbe09 Fix for deploy...
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 16:01:07 -04:00
5c94dbbff5 Maybe? Maybe not... 2023-05-08 15:59:56 -04:00
cb44eb1fab Hmmm. More trouble with secrets
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 15:53:27 -04:00
df63d7947f better secret file
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 15:47:20 -04:00
01a5ff907c Perhaps a big duh.
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-08 15:37:18 -04:00
e22e3d8bc3 Muahahahaha 2023-05-08 15:33:48 -04:00
4 changed files with 147 additions and 158 deletions

View File

@@ -1,70 +1,69 @@
# kind: pipeline
# type: docker
# name: Test Pipeline
kind: pipeline
type: docker
name: Test Pipeline
# workspace:
# path: /drone/grow
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 Test 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
# - name: Build
# image: node:latest
# commands:
# - yarn build
# - name: Send Build Status Notifications
# 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 }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
# "username":"DroneBot"
# }
# when:
# status:
# - success
# - failure
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 Test 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
- name: Build
image: node:latest
commands:
- yarn build
- name: Send Build Status Notifications
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 }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
# trigger:
# branch:
# - main
# event:
# # - pull_request
# - push
trigger:
branch:
- main
event:
- pull_request
# ---
---
kind: pipeline
type: docker
name: Publish Pipeline
@@ -79,16 +78,10 @@ steps:
- yarn install
- yarn build
- name: Publish NPM
image: plugins/npm
image: node:20-alpine
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
commands:
- yarn publish -t ${DRONE_TAG}
volumes:
- name: npmrc
path: /drone/grow/.npmrc
@@ -108,21 +101,18 @@ steps:
- success
- failure
- name: Publish Image
image: docker
environemnt:
USERNAME: 'mifi'
# from_secret: registry_username
PASSWORD: '%0z&+V5?A6PytCp8#4Z17-T}chQ9s{Lj'
# from_secret: registry_password
commands:
- '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
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: dockerconfig
path: /drone/grow/.docker/config.json
image: plugins/docker
settings:
auto_tag: true
repo: git.mifi.dev/mifi/mifi/auth
registry: git.mifi.dev
debug: true
ssh-agent-key:
from_secret: reg_token
username: <token>
password:
from_secret: reg_token
secrets: [reg_token]
- name: Report Image Publish Status
image: plugins/webhook
settings:
@@ -150,79 +140,75 @@ volumes:
host:
path: /volume1/docker/beethoven/labs-auth/.npmrc
# depends_on:
# - Test Pipeline
depends_on:
- Test Pipeline
trigger:
branch:
- main
event:
- push
# - tag
- tag
# ---
# kind: pipeline
# type: docker
# name: Deploy Pipeline
---
kind: pipeline
type: docker
name: Deploy Pipeline
# workspace:
# path: /drone/grow
workspace:
path: /drone/grow
# steps:
# - name: Deploy Container
# image: docker
# privileged: true
# environment:
# CONTAINER_PREFIX: dev
# HOST: area51.mifi.dev
# ROUTE_PREFIX: /auth
# PORT: 9001
# commands:
# - 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 rm --stop
# - docker compose -f docker-compose.staging.yml up --wait
# volumes:
# - name: env-secrets
# path: /drone/grow/staging.env
# - name: dockersock
# path: /var/run/docker.sock
# - name: dockerconfig
# path: /drone/grow/.docker/config.json
# - name: Send Status Notifications
# image: plugins/webhook
# privileged: true
# 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 }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
# "username":"DroneBot"
# }
# when:
# status:
# - success
# - failure
steps:
- name: Deploy Container
image: docker
privileged: true
environment:
CONTAINER_PREFIX: staging
HOST: area51.mifi.dev
ROUTE_PREFIX: /auth
PORT: 9001
commands:
- 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 rm --stop
- docker compose -f docker-compose.staging.yml up --wait
volumes:
- name: env-secrets
path: /drone/grow/staging.env
- name: dockersock
path: /var/run/docker.sock
- name: dockerconfig
path: /drone/grow/.docker/config.json
- name: Send Status Notifications
image: plugins/webhook
privileged: true
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 }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
"username":"DroneBot"
}
when:
status:
- success
- failure
# volumes:
# - name: dockerconfig
# host:
# path: /volume1/docker/dockerconfig.json
# - name: dockersock
# host:
# path: /var/run/docker.sock
# - name: env-secrets
# host:
# path: /volume1/docker/beethoven/labs-auth/staging.env
volumes:
- name: dockerconfig
host:
path: /volume1/docker/dockerconfig.json
- name: dockersock
host:
path: /var/run/docker.sock
- name: env-secrets
host:
path: /volume1/docker/beethoven/labs-auth/staging.env
# # depends_on:
# # - Test Pipeline
depends_on:
- Test Pipeline
# trigger:
# branch:
# - main
# event:
# - push
# # - tag
trigger:
event:
- promote
target:
- production

View File

@@ -5,14 +5,14 @@ COPY tsconfig.json ./
COPY lib ./lib
RUN ls -a
RUN yarn install
RUN yarn build:production
RUN yarn build
## this is stage two , where the app actually runs
FROM node:20-alpine AS containerize
ENV NODE_ENV ${ENV:-production}
WORKDIR /home/node/app
COPY package*.json ./
RUN yarn install --frozen-lockfile --production
COPY --from=0 /home/node/app/dist .
EXPOSE 9001
EXPOSE 27017
EXPOSE ${PORT}
CMD ["node","server/index.js"]

View File

@@ -9,6 +9,7 @@ services:
- docknet
volumes:
- '/volume1/docker/labs/auth/mongo:/data/db'
# - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
restart: unless-stopped
image: mongo:latest
auth-service:
@@ -16,6 +17,8 @@ services:
- staging.env
build: .
container_name: ${CONTAINER_PREFIX}-auth-service
environment:
- DB_HOST=${CONTAINER_PREFIX}-auth-service_mongo
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.grow.rule=Host(`${HOST}`) && Path(`${ROUTE_PREFIX}`)'

View File

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