1.0.2 • Published 2 years ago
@chatmate/common.example v1.0.2
requiremnts
- the project need's bash and docker.
- so run it one of the options below:
- linux machine
- mack os
- WSL (go for v2)
- kubernetes anbeled (i used docker desktop)
run it
- clone it
- cd into the path u cloned to
- cd into scripts folder
- run
bash run_dev.sh
a. u can add-p <number>
for custom port (defult to 3000)
b. u can add-i <image name>
for custom image name (defult to 'run_ts_image')
c. u can add-i <container name>
for custom container name (defult to 'run_ts_container')
d. u can addno-build
to not rebuild (build anyway if image not exists) - u will be asked for sudo permissions - explained at the bottom of the file (*1)
- while developing there is two options
a. edit normaly, run commands inside the container troughdocker exec
\kubectl exec
. and watch logs througdocker logs
\kubectl logs
.
b. 'Remote - Containers' (for VS code) or 'JetBrains Projector' / 'JetBrains Gateway' for webstorm (havent tried them)
adding new npm packages
it is a best practice to install pakcages from withing the container, some of the have different binaries for different OS's
test
- cd into scripts folder
- run
bash run_test.sh
(same optional parameters as the run_dev script) - u will be asked for sudo permissions - explained at the bottom of the file (*1)
debug
a 'lunch.json' file is existed for VS code.
probably wont be two hurd to
build
- cd into scripts folder
- run
bash build_for_prod.sh
- the js files will be at \/out
comments
(1)*
sudo permissions are needed for 2 resons
1. to change files while creating images
2. if u running WSL the OS that run's the code editor is WINDOWS but the files are stored on the LINUX file system. so windows need permmmisions to change the file's
* if u running on mac/linux try to remove the sudo from the scripts it might work