-
Notifications
You must be signed in to change notification settings - Fork 43
Issue 44 resolved #48
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ lerna-debug.log* | |
|
||
node_modules | ||
venv_bankapp | ||
^ | ||
dist | ||
dist-ssr | ||
*.local | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a part of #42 and someone else is working on it. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# PowerShell script equivalent to the provided Bash script | ||
|
||
# Setup | ||
|
||
Set-Location .. | ||
|
||
# Check for Dependencies | ||
if (-not (Get-Command "node" -ErrorAction SilentlyContinue)) { | ||
Write-Host "`n Node.js is not installed. Please install Node.js and npm." | ||
exit 1 | ||
} | ||
|
||
if (-not (Get-Command "python3" -ErrorAction SilentlyContinue)) { | ||
Write-Host "`n Python 3 is not installed. Please install Python 3." | ||
exit 1 | ||
} | ||
|
||
# Running JavaScript microservices | ||
|
||
function Run-Javascript-Microservice { | ||
param ( | ||
[string]$service_name, | ||
[string]$service_alias | ||
) | ||
|
||
$current_dir = Get-Location | ||
|
||
Write-Host "Running $service_name microservice..." | ||
|
||
Start-Process PowerShell -ArgumentList @" | ||
Set-Location '$current_dir\$service_name' | ||
npm install | ||
npm run $service_alias | ||
"@ | ||
|
||
Start-Sleep -Seconds 2 | ||
|
||
Write-Host "$service_name is running...`n" | ||
} | ||
|
||
Run-Javascript-Microservice -service_name "ui" -service_alias "ui" | ||
Run-Javascript-Microservice -service_name "customer-auth" -service_alias "auth" | ||
Run-Javascript-Microservice -service_name "atm-locator" -service_alias "atm" | ||
|
||
# Running Python microservices | ||
|
||
function Run-Python-Microservice { | ||
param ( | ||
[string]$service_name, | ||
[string]$service_alias | ||
) | ||
|
||
$current_dir = Get-Location | ||
|
||
Write-Host "Running $service_name microservice..." | ||
|
||
Start-Process PowerShell -ArgumentList @" | ||
Set-Location '$current_dir\$service_name' | ||
Remove-Item -Recurse venv_bankapp -ErrorAction SilentlyContinue | ||
python -m venv venv_bankapp | ||
.\venv_bankapp\Scripts\Activate | ||
pip install -r requirements.txt | ||
python '$service_alias.py' | ||
"@ | ||
|
||
Start-Sleep -Seconds 2 | ||
|
||
Write-Host "$service_name is running...`n" | ||
} | ||
|
||
Run-Python-Microservice -service_name "dashboard" -service_alias "dashboard" | ||
Run-Python-Microservice -service_name "accounts" -service_alias "accounts" | ||
Run-Python-Microservice -service_name "transactions" -service_alias "transaction" | ||
Run-Python-Microservice -service_name "loan" -service_alias "loan" | ||
|
||
Write-Host "Setup completed successfully!" |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this script? It is the same as run_local.sh right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, there are some changes in this so kept I this file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
####################################################################################### | ||
## Setup | ||
|
||
cd .. | ||
|
||
# Check for Dependencies | ||
if ! command -v node &>/dev/null; then | ||
echo "Node.js is not installed. Please install Node.js and npm." | ||
exit 1 | ||
fi | ||
|
||
# if ! command -v python3 &>/dev/null; then | ||
# echo "Python 3 is not installed. Please install Python 3." | ||
# exit 1 | ||
# fi | ||
|
||
####################################################################################### | ||
## Running Javascript microservices | ||
|
||
run_javascript_microservice() { | ||
local service_name="$1" | ||
local service_alias="$2" | ||
local current_dir="$(pwd)" | ||
|
||
echo "Running $service_name microservice..." | ||
|
||
( | ||
cd "$current_dir/$service_name" && | ||
start bash -c "npm install && npm run $service_alias" & | ||
) | ||
sleep 2 | ||
|
||
echo "$service_name is running ..." | ||
echo | ||
} | ||
|
||
run_javascript_microservice "ui" "ui" | ||
run_javascript_microservice "customer-auth" "auth" | ||
run_javascript_microservice "atm-locator" "atm" | ||
|
||
####################################################################################### | ||
# Running Python microservices | ||
|
||
# conda config --set auto_activate_base false &>/dev/null | ||
# brew update &>/dev/null | ||
# brew upgrade python3 &>/dev/null | ||
|
||
# run_python_microservice() { | ||
# local service_name="$1" | ||
# local service_alias="$2" | ||
# local current_dir="$(pwd)" | ||
|
||
# echo "Running $service_name microservice ..." | ||
|
||
# ( | ||
# cd "$current_dir/$service_name" && | ||
# start bash -c "rm -rf venv_bankapp && python3 -m venv venv_bankapp && source venv_bankapp/bin/activate && pip3 install -r requirements.txt && python3 $service_alias.py" & | ||
# ) | ||
# sleep 2 | ||
|
||
# echo "$service_name is running ..." | ||
# echo | ||
# } | ||
|
||
# run_python_microservice "dashboard" "dashboard" | ||
# run_python_microservice "accounts" "accounts" | ||
# run_python_microservice "transactions" "transaction" | ||
# run_python_microservice "loan" "loan" | ||
|
||
echo "Setup completed successfully!" |
Uh oh!
There was an error while loading. Please reload this page.