Skip to content

Commit

Permalink
[SERVER] update dev folder + add README for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Huynh Thanh Binh committed May 20, 2020
1 parent 2ff2480 commit 049e922
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 56 deletions.
22 changes: 22 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<h2>Run SaigonParking environment</h2>
Written by: Huynh Thanh Binh (bht) in May 20th, 2020<br/>

Please do like following step to start saigonparking environment <br/>
Please note that Windows is different from Ubuntu !

<h4>First time run:</h4>

(If you remove all the containers and create again, please redo)
- Run docker compose:
<br/>&emsp;&emsp; $ docker-compose up

- Execute service.sh (For Windows user, please run Git Bash Here to begin terminal)
<br/>&emsp;&emsp; $ chmod +x service.sh
<br/>&emsp;&emsp; $ ./service.sh

<h4>Another time run:</h4>
- Just run docker compose:
<br/>&emsp;&emsp; $ docker-compose up

<h4>Another frequently used command</h4>
(Can be found in resources folder, file commands.txt)
5 changes: 5 additions & 0 deletions dev/service.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/sh
export MSYS_NO_PATHCONV=1

KONG_ADMIN_HOST=localhost
KONG_ADMIN_PORT=8001
CONNECT_TIMEOUT=20000

# create function to prevent boilerplate code
registerService() {
printf "\nRegister %s service\n" $1
curl -XPOST ${KONG_ADMIN_HOST}:${KONG_ADMIN_PORT}/services \
Expand All @@ -17,6 +19,7 @@ registerService() {
printf "\n"
}

# create function to prevent boilerplate code
registerServiceGrpcRoute() {
printf "\nRegister %s service gRPC route\n" $1
curl -XPOST ${KONG_ADMIN_HOST}:${KONG_ADMIN_PORT}/services/$1/routes \
Expand Down Expand Up @@ -52,3 +55,5 @@ SERVICE_PATH=/com.bht.saigonparking.api.grpc.parkinglot.ParkingLotService/

registerService ${SERVICE_NAME} ${SERVICE_HOST} ${SERVICE_PORT} ${CONNECT_TIMEOUT}
registerServiceGrpcRoute ${SERVICE_NAME} ${SERVICE_PATH}

export MSYS_NO_PATHCONV=0
54 changes: 0 additions & 54 deletions dev/service_windows.sh

This file was deleted.

7 changes: 5 additions & 2 deletions resources/references.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Document's name: Saigon Parking Project References
Author: Huynh Thanh Binh
Last updated: Tue, May 19th, 2020
Last updated: Wed, May 20th, 2020
========================================================================================================================

01. gRPC error handling:
Expand Down Expand Up @@ -136,4 +136,7 @@ Last updated: Tue, May 19th, 2020
https://www.baeldung.com/convert-input-stream-to-array-of-bytes

45. gRPC: Random CANCELLED exception on RPC calls - gRPC Asynchronous Stub Calling
https://stackoverflow.com/questions/57110811/grpc-random-cancelled-exception-on-rpc-calls
https://stackoverflow.com/questions/57110811/grpc-random-cancelled-exception-on-rpc-calls

46. Git Bash confuse with Slash '/' when running bash script on Windows - Asked by me =))))
https://stackoverflow.com/questions/61907994/git-bash-confuse-with-slash-when-running-bash-script-on-windows

0 comments on commit 049e922

Please sign in to comment.