Skip to content

Commit 096e6a7

Browse files
authored
Dev mode (#8)
* Extra files for local development * devcontainer * Delete .devcontainer directory * dev quick commands * dev-command completes * Dont build docker with changes to Makefile * Test locally * dev * dev
1 parent d8e3914 commit 096e6a7

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/docker-publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'brokers/**'
88
- 'README.md'
99
- '.gitignore'
10+
- 'Makefile'
1011

1112
pull_request:
1213
branches: [ main ]
1314
paths-ignore:
1415
- 'brokers/**'
1516
- 'README.md'
1617
- '.gitignore'
18+
- 'Makefile'
1719

1820
release:
1921
types: [ published ]
@@ -30,8 +32,24 @@ on:
3032

3133
jobs:
3234

35+
build-local:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: npm run build
43+
run: |
44+
make node-build
45+
46+
- name: npm run preview
47+
run: |
48+
npm run preview -- --port 8080 & sleep 10; curl -f http://localhost:8080 || exit 1
49+
3350
build-test:
3451
runs-on: ubuntu-latest
52+
needs: build-local
3553

3654
steps:
3755
- name: Checkout repository

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: node-env-prep mongo-start mongo-stop mongo-restart mongo-reset node-build dev-start
2+
3+
mongo-start:
4+
docker compose -f ./docker-compose-local.yml up -d mongo
5+
6+
mongo-stop:
7+
docker compose -f ./docker-compose-local.yml down mongo
8+
9+
mongo-restart: mongo-stop mongo-start
10+
11+
mongo-reset: mongo-stop
12+
docker rm -f tradenote_db
13+
$(MAKE) mongo-start
14+
15+
node-env-prep:
16+
. $$NVM_DIR/nvm.sh; nvm install 18
17+
. $$NVM_DIR/nvm.sh; nvm use 18
18+
. $$NVM_DIR/nvm.sh; nvm use 18; npm install
19+
20+
node-build: node-env-prep
21+
. $$NVM_DIR/nvm.sh; nvm use 18; npm run build
22+
23+
dev-start: mongo-start node-build
24+
. $$NVM_DIR/nvm.sh; nvm use 18; \
25+
MONGO_URI=mongodb://tradenote:tradenote@localhost:27017/tradenote?authSource=admin \
26+
TRADENOTE_DATABASE=tradenote APP_ID=123456 MASTER_KEY=123456 TRADENOTE_PORT=8080 \
27+
npm run start

0 commit comments

Comments
 (0)