Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/api_plugin_nodemailer_with_microsoft_authentication nodemailer update #9

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 76 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
version: 2
version: 2.1

# The following stanza defines a map named defaults with a variable that may be
# inserted using the YAML merge (<<: *) key later in the file to save some
# typing. See http://yaml.org/type/merge.html for details.
defaults: &defaults
env: &env
environment:
CI_SCRIPTS: "npx --quiet --package @reactioncommerce/[email protected]"
DOCKER_REPOSITORY: "reactioncommerce/reaction"
DOCKER_NAMESPACE: "reactioncommerce"
DOCKER_NAME: "reaction"
DOCKER_REPOSITORY: "gcr.io/appliance-shack-cluster2/reaction-api"
DOCKER_NAME: "reaction-api"
GLOBAL_CACHE_VERSION: “v3”

defaults: &build
<<: *env
docker:
- image: cimg/node:18.10.0
- image: cimg/node:18.18.2

install_pnpm: &install_pnpm
- run:
Expand All @@ -22,9 +25,28 @@ pnpm_install: &pnpm_install
name: Install PNPM dependencies
command: pnpm install -r

integration: &integration
<<: *env
docker:
- image: cimg/node:18.18.2
- image: redis
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
name: mongo
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger

initialize_mongo: &initialize_mongo
- run:
name: Initialize Mongo Replica Set
command: |
MONGO_CONTAINER_ID=$(docker ps --filter "ancestor=mongo:4.0" --format "{{.ID}}")
docker logs $MONGO_CONTAINER_ID
docker exec -it $MONGO_CONTAINER_ID mongo --host mongo --port 27017 --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongo:27017"}]})'
docker logs $MONGO_CONTAINER_ID

jobs:
install-dependencies:
<<: *defaults
<<: *build
steps:
- checkout
- restore_cache:
Expand All @@ -43,7 +65,7 @@ jobs:
- node_modules

dockerfile-lint:
<<: *defaults
<<: *build
steps:
- checkout
- setup_remote_docker:
Expand All @@ -52,7 +74,7 @@ jobs:
name: Lint Dockerfiles
command: ${CI_SCRIPTS} lint-dockerfiles
eslint:
<<: *defaults
<<: *build
steps:
- checkout
- restore_cache:
Expand All @@ -66,7 +88,7 @@ jobs:
command: pnpm run lint

graphql-lint:
<<: *defaults
<<: *build
steps:
- checkout
- restore_cache:
Expand All @@ -80,7 +102,7 @@ jobs:
command: pnpm -r run lint:gql

test-unit:
<<: *defaults
<<: *build
steps:
- checkout
- restore_cache:
Expand All @@ -96,100 +118,85 @@ jobs:
resource_class: large

test-integration-query:
<<: *defaults
docker:
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
<<: *integration
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
keys:
- reaction-v7-node-modules-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
- reaction-v7-node-modules-{{ .Branch }}
- <<: *install_pnpm
- <<: *pnpm_install
- <<: *initialize_mongo
- run:
name: Run Integration Query Tests
environment:
MONGO_URL: mongodb://localhost:27017/test
MONGO_URL: mongodb://mongo:27017/test
MONGO_USE_UNIFIED_TOPOLOGY: false
REDIS_SERVER: redis://localhost:6379
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
echo "MONGO_URL: $MONGO_URL"
echo "REDIS_SERVER: $REDIS_SERVER"
pnpm run env
pnpm run test:integration:query
resource_class: large

test-integration-mutation1:
<<: *defaults
docker:
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
<<: *integration
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
keys:
- reaction-v7-node-modules-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
- reaction-v7-node-modules-{{ .Branch }}
- <<: *install_pnpm
- <<: *pnpm_install
- <<: *initialize_mongo
- run:
name: Run Integration Mutation Tests
environment:
MONGO_URL: mongodb://localhost:27017/test
MONGO_URL: mongodb://mongo:27017/test
MONGO_USE_UNIFIED_TOPOLOGY: false
REDIS_SERVER: redis://localhost:6379
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
echo "MONGO_URL: $MONGO_URL"
echo "REDIS_SERVER: $REDIS_SERVER"
pnpm run env
pnpm run test:integration:mutation1
resource_class: large

test-integration-mutation2:
<<: *defaults
docker:
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
<<: *integration
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- restore_cache:
keys:
- reaction-v7-node-modules-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
- reaction-v7-node-modules-{{ .Branch }}
- <<: *install_pnpm
- <<: *pnpm_install
- <<: *initialize_mongo
- run:
name: Run Integration Mutation Tests
environment:
MONGO_URL: mongodb://localhost:27017/test
MONGO_URL: mongodb://mongo:27017/test
MONGO_USE_UNIFIED_TOPOLOGY: false
REDIS_SERVER: redis://localhost:6379
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
echo "MONGO_URL: $MONGO_URL"
echo "REDIS_SERVER: $REDIS_SERVER"
pnpm run env
pnpm run test:integration:mutation2
resource_class: large

release:
<<: *defaults
<<: *build
steps:
- checkout
- <<: *install_pnpm
Expand All @@ -202,7 +209,7 @@ jobs:
command: pnpm publish -r

docker-build-push:
<<: *defaults
<<: *build
steps:
- checkout
- run:
Expand All @@ -213,7 +220,7 @@ jobs:
circleci-agent step halt
fi
- run:
name: Wait for packages to be propagated
name: Wait for published packages to propagate
command: sleep 350
- setup_remote_docker:
docker_layer_caching: true
Expand All @@ -230,32 +237,40 @@ jobs:
echo "ROOT_URL=http://localhost:3000" >> .env
echo "STORE_URL=http://localhost:4000" >> .env
echo "STRIPE_API_KEY=YOUR_PRIVATE_STRIPE_API_KEY" >> .env
echo "ES_CATALOG_SYNC_ENTERPRISESEARCH_URL=http://localhost:9090" >> .env
echo "ES_CATALOG_SYNC_ENTERPRISESEARCH_KEY=secretkey" >> .env
echo "REDIS_SERVER=redis://127.0.0.1:6379" >> .env
- run:
name: Create reaction.localhost network
command: docker network create "reaction.localhost" || true
- run:
name: Update docker-compose.circleci.yml with new reaction image version
name: Configure docker-compose.yml with the latest docker image reference
command: |
VERSION=$(cat ./apps/reaction/package.json | grep -m 1 version | sed 's/[^0-9.]//g')
sed -i -e "s/REACTION_VERSION/$VERSION/g" ./docker-compose.circleci.yml
cp -i docker-compose.circleci.yml docker-compose.yml
sed -i "s/VERSION/$VERSION/g" ./docker-compose.yml
sed -i "s/DOCKER_REPOSITORY/${DOCKER_REPOSITORY}\/reaction-api/g" ./docker-compose.yml
- run:
name: Run image
command: docker-compose -f ./docker-compose.circleci.yml up -d
command: docker-compose -f ./docker-compose.yml up -d
- run:
name: Wait for image run completed
command: sleep 30
- run:
name: Show logs of api container
command: docker container logs project-api-1
- run:
name: Test new docker image
command: |
docker exec project-api-1 curl --retry 5 --fail -X POST 'http://localhost:3000/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query ping { ping }","variables":{}}'
- run:
name: Login to gcr.io docker registry
command: echo ${GCR_JSON_KEY} | docker login -u _json_key --password-stdin https://gcr.io
- run:
name: Push production Docker image
command: |
VERSION=$(cat ./apps/reaction/package.json | grep -m 1 version | sed 's/[^0-9.]//g')
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
docker push ${DOCKER_REPOSITORY}:${VERSION}
docker push ${DOCKER_REPOSITORY}:latest

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: PRERELEASE
on:
workflow_dispatch:
pull_request:
branches:
- prerelease
pull_request:
types:
- closed

Expand Down
5 changes: 5 additions & 0 deletions CleanseProcessEnv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const sortedEnv = {};
Object.keys(process.env).sort().forEach((key) => {
sortedEnv[key] = key.match(/token|pass|secret|_id|id_/i) ? "******" : process.env[key];
});
process.stdout.write(JSON.stringify(sortedEnv, undefined, " "));
48 changes: 24 additions & 24 deletions apps/meteor-blaze-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,39 @@
"retainLines": true
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@babel/runtime-corejs2": "^7.7.6",
"@bugslifesolutions/file-collections": "../../packages/file-collections",
"@bugslifesolutions/file-collections-sa-base": "../../packages/file-collections-sa-base",
"@bugslifesolutions/file-collections-sa-gridfs": "../../packages/file-collections-sa-gridfs",
"@babel/runtime": "^7.23.2",
"@babel/runtime-corejs2": "^7.23.2",
"@bugslifesolutions/file-collections": "link:../../packages/file-collections",
"@bugslifesolutions/file-collections-sa-base": "link:../../packages/file-collections-sa-base",
"@bugslifesolutions/file-collections-sa-gridfs": "link:../../packages/file-collections-sa-gridfs",
"bootstrap": "^3.4.1",
"content-disposition": "^0.5.2",
"content-disposition": "^0.5.4",
"extend": "~3.0.2",
"gridfs-stream": "^1.1.1",
"meteor-node-stubs": "^0.4.1",
"node-fetch": "^2.6.6",
"path-parser": "^4.0.4",
"query-string": "^5.1.0",
"node-fetch": "^2.7.0",
"path-parser": "^4.2.0",
"query-string": "^5.1.1",
"sharp": "^0.30.7",
"tus-js-client": "^1.5.1",
"tus-js-client": "^1.8.0",
"tus-node-server": "~0.3.2"
},
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.7.4",
"@babel/plugin-proposal-export-namespace-from": "^7.7.4",
"@babel/plugin-proposal-function-sent": "^7.7.4",
"@babel/plugin-proposal-json-strings": "^7.7.4",
"@babel/plugin-proposal-numeric-separator": "^7.7.4",
"@babel/plugin-proposal-throw-expressions": "^7.7.4",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-syntax-import-meta": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.6",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.3",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-function-sent": "^7.23.3",
"@babel/plugin-proposal-json-strings": "^7.18.6",
"@babel/plugin-proposal-numeric-separator": "^7.18.6",
"@babel/plugin-proposal-throw-expressions": "^7.23.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0"
}
}
2 changes: 1 addition & 1 deletion apps/reaction/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const jestConfig = {
// testResultsProcessor: null,

// This option allows use of a custom test runner
testRunner: "jasmine2",
// testRunner: "jasmine2",

snapshotFormat: {
escapeString: true,
Expand Down
Loading