44 Commits

Author SHA1 Message Date
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
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
6 changed files with 211 additions and 207 deletions

View File

@@ -1,148 +1,145 @@
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
steps: steps:
- name: Build Package # - name: Build Package
image: node:latest # image: node:latest
commands: # commands:
- yarn install # - yarn install
- yarn build # - yarn build
- name: Publish NPM # - name: Publish NPM
image: plugins/npm # image: node:20-alpine
failure: ignore # failure: ignore
settings: # commands:
username: # - yarn publish -t ${DRONE_TAG}
from_secret: registry_username # volumes:
password: # - name: npmrc
from_secret: registry_password # path: /drone/grow/.npmrc
registry: https://git.mifi.dev/api/packages/mifi/npm # - name: Publish NPM
token: # image: plugins/npm
- from_secret: gitea_token # failure: ignore
volumes: # settings:
- name: npmrc # username:
path: /drone/grow/.npmrc # from_secret: registry_username
- name: Report NPM Publish Status # password:
image: plugins/webhook # from_secret: registry_password
settings: # registry: https://git.mifi.dev/api/packages/mifi/npm
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r # token:
content_type: application/json # - from_secret: gitea_token
template: | # volumes:
{ # - name: npmrc
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png", # path: /drone/grow/.npmrc
"text": "[{{ repo.name }} - New npm package release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}", # - name: Report NPM Publish Status
"username":"DroneBot" # image: plugins/webhook
} # settings:
when: # urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
status: # content_type: application/json
- success # template: |
- failure # {
# "icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
# "text": "[{{ repo.name }} - New npm package release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
# "username":"DroneBot"
# }
# when:
# status:
# - success
# - failure
- name: Publish Image - name: Publish Image
image: docker image: docker
environment: failure: ignore
USERNAME:
from_secret: registry_username
PASSWORD:
from_secret: registry_password
commands: commands:
- docker login -u ${USERNAME} -p {PASSWORD} git.mifi.dev - 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 build -t git.mifi.dev/mifi/mifi/auth:latest -t git.mifi.dev/mifi/mifi/auth:${DRONE_TAG:-latest} .'
- 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 - name: Publish Image (plugin)
# image: plugins/docker image: plugins/docker
# settings: settings:
# auto_tag: true auto_tag: true
# squash: true repo: git.mifi.dev/mifi/mifi/auth
# repo: git.mifi.dev/mifi/auth registry: git.mifi.dev
# context: mifi debug: true
# registry: git.mifi.dev ssh-agent-key:
# username: from_secret: reg_token
# from_secret: registry_username username: <token>
# password: password:
# from_secret: registry_password from_secret: reg_token
# ssh-agent-key: secrets: [reg_token]
# 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:
@@ -170,74 +167,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:
- main
event:
- push
# - tag
# ---
# kind: pipeline
# type: docker
# name: Deploy Pipeline
# workspace:
# path: /drone/grow
# 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
# # depends_on:
# # - Test Pipeline
# trigger:
# branch: # branch:
# - main # - main
event: # event:
# - push # - push
- tag # # - tag
---
kind: pipeline
type: docker
name: Deploy Pipeline
workspace:
path: /drone/grow
steps:
- name: Deploy Container
image: docker
privileged: true
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.secrets.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.secrets.env
depends_on:
- Test Pipeline
trigger:
# branch:
# - main
event:
# - push
- tag

View File

@@ -1,6 +0,0 @@
HOST=area51.mifi.dev
PORT=9001
ROUTE_PREFIX=/auth
CONTAINER_PREFIX=mifi

View File

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

View File

@@ -3,6 +3,9 @@ version: '3.8'
services: services:
auth-service_mongo: auth-service_mongo:
env_file: .env.dev 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
@@ -15,7 +18,13 @@ services:
image: mongo:latest image: mongo:latest
auth-service: auth-service:
env_file: .env.dev 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

@@ -2,32 +2,31 @@ 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: env_file:
- .env.staging - staging.env
- staging.secrets.env
networks: networks:
- docknet - docknet
volumes: volumes:
- '/volume1/docker/labs/auth/mongo:/data/db' - '/volume1/docker/labs/auth/mongo:/data/db'
# - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
restart: unless-stopped restart: unless-stopped
image: mongo:latest image: mongo:latest
auth-service: auth-service:
env_file: env_file:
- .env.staging - staging.env
- staging.secrets.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}-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}`)'
- 'traefik.http.routers.grow.entrypoints=websecure' - 'traefik.http.routers.grow.entrypoints=websecure'
- 'traefik.http.routers.grow.tls=true' - 'traefik.http.routers.grow.tls=true'
- 'traefik.http.routers.grow.tls.certresolver=letsencrypt' - 'traefik.http.routers.grow.tls.certresolver=letsencrypt'
- 'traefik.http.routers.grow.service=grow-service' - 'traefik.http.routers.grow.service=grow-service'
- 'traefik.http.services.grow-service.loadbalancer.server.port=$${PORT}' - 'traefik.http.services.grow-service.loadbalancer.server.port=${PORT}'
networks: networks:
- docknet - docknet
restart: unless-stopped restart: unless-stopped

View File

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