Skip to content

Commit

Permalink
Revert "feat(root, api-service, worker, ws, webhook): migrate from aw…
Browse files Browse the repository at this point in the history
…s ssm to…"

This reverts commit 3abfb01.
  • Loading branch information
merrcury authored Jan 8, 2025
1 parent a179b7d commit ea2d6c7
Show file tree
Hide file tree
Showing 19 changed files with 786 additions and 1,697 deletions.
3 changes: 1 addition & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,7 @@
"touchpoint",
"Angularjs",
"navigatable",
"facated",
"dotenvcreate"
"facated"
],
"flagWords": [],
"patterns": [
Expand Down
1 change: 0 additions & 1 deletion .github/actions/docker/build-api/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ runs:
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
set -x
cp scripts/dotenvcreate.mjs apps/api/src/dotenvcreate.mjs
cd apps/api && pnpm run docker:build
- name: Tag and test
Expand Down
1 change: 0 additions & 1 deletion .github/actions/docker/build-worker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ runs:
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
set -x
cp scripts/dotenvcreate.mjs apps/worker/src/dotenvcreate.mjs
cd apps/worker && pnpm run docker:build
- name: Tag and test
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:
if: ${{ inputs.slim == 'false' }}
uses: supercharge/[email protected]
with:
mongodb-version: 8.0
mongodb-version: 5.0.29

- name: 🛟 Install dependencies
shell: bash
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dev-deploy-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ jobs:
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
set -x
cp scripts/dotenvcreate.mjs apps/ws/src/dotenvcreate.mjs
cd apps/ws && pnpm run docker:build
- name: Tag and test
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
--platform=linux/amd64
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
cp scripts/dotenvcreate.mjs apps/api/src/dotenvcreate.mjs
cd apps/api && pnpm --silent --workspace-root pnpm-context -- apps/api/Dockerfile | BULL_MQ_PRO_NPM_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} docker buildx build --secret id=BULL_MQ_PRO_NPM_TOKEN --build-arg PACKAGE_PATH=apps/api - -t novu-api --load $DOCKER_BUILD_ARGUMENTS
docker tag novu-api $REGISTRY/$REPOSITORY:latest
docker tag novu-api $REGISTRY/$REPOSITORY:prod
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
--platform=linux/amd64
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
cp scripts/dotenvcreate.mjs apps/worker/src/dotenvcreate.mjs
cd apps/worker && pnpm --silent --workspace-root pnpm-context -- apps/worker/Dockerfile | BULL_MQ_PRO_NPM_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} docker buildx build --secret id=BULL_MQ_PRO_NPM_TOKEN --build-arg PACKAGE_PATH=apps/worker - -t novu-worker --load $DOCKER_BUILD_ARGUMENTS
docker tag novu-worker $REGISTRY/$REPOSITORY:latest
docker tag novu-worker $REGISTRY/$REPOSITORY:prod
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prod-deploy-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
--platform=linux/amd64
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
cp scripts/dotenvcreate.mjs apps/ws/src/dotenvcreate.mjs
BULL_MQ_PRO_NPM_TOKEN=${BULL_MQ_PRO_NPM_TOKEN} docker buildx build --secret id=BULL_MQ_PRO_NPM_TOKEN -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --load -f apps/ws/Dockerfile . $DOCKER_BUILD_ARGUMENTS
docker run --network=host --name api -dit --env NODE_ENV=test $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://127.0.0.1:1340/v1/health-check | grep 'ok'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/reusable-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
--platform=linux/amd64 --provenance=false
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
cp scripts/dotenvcreate.mjs $PROJECT_PATH/src/dotenvcreate.mjs
cd $PROJECT_PATH && npm run docker:build
docker tag $LOCAL_TAG $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker tag $LOCAL_TAG $REGISTRY/$REPOSITORY:$ENV_TAG
Expand All @@ -138,7 +137,6 @@ jobs:
--platform=linux/amd64
--output=type=image,name=$REGISTRY/$REPOSITORY,push-by-digest=true,name-canonical=true
run: |
cp scripts/dotenvcreate.mjs $PROJECT_PATH/src/dotenvcreate.mjs
cd $PROJECT_PATH && npm run docker:build
docker tag $LOCAL_TAG $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker tag $LOCAL_TAG $REGISTRY/$REPOSITORY:$ENV_TAG
Expand Down
3 changes: 1 addition & 2 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ RUN --mount=type=secret,id=BULL_MQ_PRO_NPM_TOKEN,uid=1000 export BULL_MQ_PRO_NPM

WORKDIR /usr/src/app/apps/api

RUN cp src/dotenvcreate.mjs dist/dotenvcreate.mjs
RUN cp src/.example.env dist/.env
RUN cp src/.env.test dist/.env.test
RUN cp src/.env.development dist/.env.development
Expand Down Expand Up @@ -70,4 +69,4 @@ RUN --mount=type=cache,id=pnpm-store-api,target=/root/.pnpm-store\
ENV NEW_RELIC_NO_CONFIG_FILE=true

WORKDIR /usr/src/app/apps/api
ENTRYPOINT [ "sh", "-c", "node dist/dotenvcreate.mjs -s=novu/api -r=$NOVU_REGION -e=$NOVU_ENTERPRISE -v=$NODE_ENV && pm2-runtime start dist/main.js" ]
CMD [ "pm2-runtime","start", "dist/main.js" ]
5 changes: 2 additions & 3 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"admin:remove-organization": "cross-env NODE_ENV=local MIGRATION=true ts-node --transpileOnly ./admin/remove-organization.ts"
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.716.0",
"@godaddy/terminus": "^4.12.1",
"@google-cloud/storage": "^6.2.3",
"@maily-to/render": "^0.0.17",
Expand Down Expand Up @@ -61,8 +60,6 @@
"@sentry/tracing": "^7.40.0",
"@types/newrelic": "^9.14.6",
"@upstash/ratelimit": "^0.4.4",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"axios": "^1.6.8",
"bcrypt": "^5.0.0",
"body-parser": "^1.20.0",
Expand Down Expand Up @@ -105,6 +102,8 @@
"twilio": "^4.14.1",
"uuid": "^8.3.2",
"zod": "^3.23.8",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"zod-to-json-schema": "^3.23.3"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions apps/webhook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ RUN --mount=type=cache,id=pnpm-store-webhook,target=/root/.pnpm-store \

# Set the working directory to the webhook app and copy example environment file
WORKDIR /usr/src/app/apps/webhook
RUN cp src/dotenvcreate.mjs dist/dotenvcreate.mjs
RUN cp src/.example.env dist/.env
RUN cp src/.env.test dist/.env.test
RUN cp src/.env.development dist/.env.development
RUN cp src/.env.production dist/.env.production

# Set the working directory to the root of the app
WORKDIR /usr/src/app
Expand Down Expand Up @@ -51,4 +47,4 @@ RUN --mount=type=cache,id=pnpm-store-webhook,target=/root/.pnpm-store \

# Set the working directory to the webhook app and start the application using pm2-runtime
WORKDIR /usr/src/app/apps/webhook
ENTRYPOINT [ "sh", "-c", "node dist/dotenvcreate.mjs -s=novu/webhook -r=$NOVU_REGION -e=$NOVU_ENTERPRISE -v=$NODE_ENV && pm2-runtime start dist/main.js" ]
CMD [ "pm2-runtime", "start", "dist/main.js" ]
4 changes: 1 addition & 3 deletions apps/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"test:e2e": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' NODE_ENV=test E2E_RUNNER=true mocha --timeout 10000 --require ts-node/register --exit --file e2e/setup.ts e2e/**/*.e2e.ts src/**/*.e2e.ts"
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.716.0",
"@nestjs/axios": "3.0.3",
"@nestjs/common": "10.4.1",
"@nestjs/core": "10.4.1",
Expand Down Expand Up @@ -49,8 +48,7 @@
"newrelic": "^12.8.1",
"reflect-metadata": "0.2.2",
"rimraf": "^3.0.2",
"rxjs": "7.8.1",
"yargs": "^17.7.2"
"rxjs": "7.8.1"
},
"devDependencies": {
"@nestjs/cli": "10.4.5",
Expand Down
3 changes: 1 addition & 2 deletions apps/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ RUN --mount=type=secret,id=BULL_MQ_PRO_NPM_TOKEN,uid=1000 export BULL_MQ_PRO_NPM

WORKDIR /usr/src/app/apps/worker

RUN cp src/dotenvcreate.mjs dist/dotenvcreate.mjs
RUN cp src/.example.env dist/.env
RUN cp src/.env.test dist/.env.test
RUN cp src/.env.development dist/.env.development
Expand Down Expand Up @@ -70,4 +69,4 @@ RUN --mount=type=cache,id=pnpm-store-worker,target=/root/.pnpm-store\
ENV NEW_RELIC_NO_CONFIG_FILE=true

WORKDIR /usr/src/app/apps/worker
ENTRYPOINT [ "sh", "-c", "node dist/dotenvcreate.mjs -s=novu/worker -r=$NOVU_REGION -e=$NOVU_ENTERPRISE -v=$NODE_ENV && pm2-runtime start dist/main.js" ]
CMD [ "pm2-runtime","start", "dist/main.js" ]
1 change: 0 additions & 1 deletion apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"test:e2e": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' NODE_ENV=test E2E_RUNNER=true mocha --timeout 10000 --require ts-node/register --exit --file e2e/setup.ts src/**/*.e2e.ts"
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.716.0",
"@nestjs/axios": "3.0.3",
"@nestjs/common": "10.4.1",
"@nestjs/core": "10.4.1",
Expand Down
3 changes: 1 addition & 2 deletions apps/ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ RUN --mount=type=secret,id=BULL_MQ_PRO_NPM_TOKEN,uid=1000 export BULL_MQ_PRO_NPM

WORKDIR /usr/src/app/apps/ws

RUN cp src/dotenvcreate.mjs dist/dotenvcreate.mjs
RUN cp src/.example.env dist/.env
RUN cp src/.env.test dist/.env.test
RUN cp src/.env.development dist/.env.development
RUN cp src/.env.production dist/.env.production

ENTRYPOINT [ "sh", "-c", "node dist/dotenvcreate.mjs -s=novu/ws -r=$NOVU_REGION -e=$NOVU_ENTERPRISE -v=$NODE_ENV && pm2-runtime start dist/main.js" ]
CMD [ "pm2-runtime", "dist/main.js" ]
3 changes: 1 addition & 2 deletions apps/ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{\"strictNullChecks\": false}' NODE_ENV=test E2E_RUNNER=true mocha --timeout 10000 --require ts-node/register --exit --file e2e/setup.ts './src/**/*.spec.ts'"
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.716.0",
"@godaddy/terminus": "^4.3.1",
"@nestjs/common": "10.4.1",
"@nestjs/core": "10.4.1",
Expand All @@ -37,8 +36,8 @@
"@novu/testing": "workspace:*",
"@sentry/browser": "^8.33.1",
"@sentry/hub": "^7.114.0",
"@sentry/nestjs": "^8.33.1",
"@sentry/node": "^8.33.1",
"@sentry/nestjs": "^8.33.1",
"@sentry/profiling-node": "^8.33.1",
"@sentry/tracing": "^7.40.0",
"@socket.io/admin-ui": "^0.5.1",
Expand Down
Loading

0 comments on commit ea2d6c7

Please sign in to comment.