Skip to content

Commit e28671f

Browse files
committed
Merge branch 'master' into rabbitmq-eventbus
2 parents 364628e + d9f9adf commit e28671f

File tree

192 files changed

+4892
-2459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+4892
-2459
lines changed

.github/workflows/nodejs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
matrix:
1111
node-version: [12.x, 14.x]
1212
mongodb-version: [4.0, 4.2]
13+
elasticsearch-version: ['7.9.3']
1314

1415
steps:
1516
- uses: actions/checkout@v1
@@ -21,6 +22,21 @@ jobs:
2122
uses: wbari/[email protected]
2223
with:
2324
mongoDBVersion: ${{ matrix.mongodb-version }}
25+
- name: Configure sysctl limits
26+
run: |
27+
sudo swapoff -a
28+
sudo sysctl -w vm.swappiness=1
29+
sudo sysctl -w fs.file-max=262144
30+
sudo sysctl -w vm.max_map_count=262144
31+
- name: Launch elasticsearch
32+
uses: getong/[email protected]
33+
with:
34+
elasticsearch version: ${{ matrix.elasticsearch-version }}
35+
host port: 9200
36+
container port: 9200
37+
host node port: 9300
38+
node port: 9300
39+
discovery type: 'single-node'
2440
- name: npm install, build, and test
2541
run: |
2642
npm install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist/
44
logs/
55
src/Contexts/Mooc/Courses/infrastructure/persistence/courses.*
66
data
7+
test-results.xml

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v12.18.3

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.PHONY = default deps build test start-mooc-backend clean start-database start-backoffice-frontend
22

3+
# Shell to use for running scripts
4+
SHELL := $(shell which bash)
35
IMAGE_NAME := codelytv/typescript-ddd-skeleton
46
SERVICE_NAME := app
57
MOOC_APP_NAME := mooc
@@ -40,6 +42,6 @@ start-backoffice-frontend: build
4042
clean:
4143
docker-compose down --rmi local --volumes --remove-orphans
4244

43-
# Start mongodb container in background
45+
# Start databases containers in background
4446
start_database:
45-
docker-compose up -d mongo
47+
docker-compose up -d mongo elasticsearch

cucumber.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
let common = [
2-
'tests/**/features/**/*.feature', // Specify our feature files
3-
'--require-module ts-node/register', // Load TypeScript module
4-
'--require tests/**/features/step_definitions/*.steps.ts' // Load step definitions
1+
const common = [
2+
'--require-module ts-node/register' // Load TypeScript module
3+
];
4+
5+
const backoffice_backend = [
6+
...common,
7+
'tests/apps/backoffice/backend/features/**/*.feature',
8+
'--require tests/apps/backoffice/backend/features/step_definitions/*.steps.ts'
9+
].join(' ');
10+
const mooc_backend = [
11+
...common,
12+
'tests/apps/mooc/backend/features/**/*.feature',
13+
'--require tests/apps/mooc/backend/features/step_definitions/*.steps.ts'
514
].join(' ');
615

716
module.exports = {
8-
default: common
17+
backoffice_backend,
18+
mooc_backend
919
};

cypress.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"video": false,
3+
"screenshotOnRunFailure": false,
4+
"testFiles": "**/*.cypress.*",
5+
"integrationFolder": "tests/apps",
6+
"fixturesFolder": "tests/utils/cypress/fixtures",
7+
"pluginsFile": "tests/utils/cypress/plugins/index.ts"
8+
}

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ x-app-service: &default-app
77
- MONGO_URL=mongodb://mongo:27017/dev
88
depends_on:
99
- mongo
10+
- kibana
11+
- elasticsearch
1012
volumes:
1113
- .:/code:delegated
1214
- node_modules:/code/node_modules:delegated
@@ -34,6 +36,32 @@ services:
3436
ports:
3537
- 27017:27017
3638

39+
elasticsearch:
40+
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
41+
container_name: codely-elasticsearch
42+
environment:
43+
- node.name=codely-elasticsearch
44+
- discovery.type=single-node #Elasticsearch forms a single-node cluster
45+
- bootstrap.memory_lock=true # might cause the JVM or shell session to exit if it tries to allocate more memory than is available!
46+
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
47+
ulimits:
48+
memlock:
49+
soft: -1 # The memlock soft and hard values configures the range of memory that ElasticSearch will use. Setting this to –1 means unlimited.
50+
hard: -1
51+
volumes:
52+
- esdata:/usr/share/elasticsearch/data
53+
ports:
54+
- '9200:9200'
55+
56+
kibana:
57+
image: docker.elastic.co/kibana/kibana:7.8.1
58+
container_name: codely-kibana
59+
environment:
60+
ELASTICSEARCH_URL: http://codely-elasticsearch:9200
61+
ELASTICSEARCH_HOSTS: http://codely-elasticsearch:9200
62+
ports:
63+
- 5601:5601
64+
3765
rabbitmq:
3866
image: 'rabbitmq:3.8-management'
3967
ports:
@@ -42,3 +70,5 @@ services:
4270

4371
volumes:
4472
node_modules:
73+
esdata:
74+
driver: local

0 commit comments

Comments
 (0)