Virtual machine update
After merging all pull requests to specific project/branch you can update the virtual machine by following next steps:
on password requirement use password: d _ _ _ s _ _ _
on git code requirement use password: a _ _ _ a _ _ _f
Open CMD anywhere on the computer and run:
ssh ds@172.20.0.30
There are 3 main groups of projects: JudoManager (JM), IJF and Internal tools, which covers both JM and IJF
JudoManager (JM) group
For JudoManager API Sharp (JM DATA v2) and/or JudoManager Account project run all commands one by one in following order:
cd ~/code/repo/judo/judomanager-sharp
sudo service judomanager-sharp stop
sudo service judomanager-account stop
git pull --rebase
sudo service judomanager-sharp start
sudo service judomanager-account start
For JudoManager WSRT project run all commands one by one in following order:
cd ~/code/repo/judo/judoregister_ws_rt
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For JudoManager Portal project run all commands one by one in following order (note that JudoManager API Sharp project has to be up and running):
cd ~/code/repo/judo/judomanager-portal
git pull --rebase
pm2 ps
Check PortalApp ID, insert it to "[PortalApp ID], delete brackets and run command:
pm2 restart [PortalApp ID]
To check log run command:
pm2 log [PortalApp ID]
In case pm2 restart [PortalApp ID] doesn't work, run next commands:
cd ~/code/repo/judo/judomanager-portal/app
pm2 del [PortalApp ID]
pm2 start npm --name "PortalApp" -- start
This row DOES NOT have to be run again
pm2 restart [PortalApp ID]
For JudoManager reporting server project run all commands one by one in following order:
cd ~/code/repo/judo/judoregister-desktop/JudoRegister.Server.Reporting
sudo service judomanager-reporting stop
git pull --rebase
sudo service judomanager-reporting start
For JudoManager Admin (judoregister-web) project run all commands one by one in following order:
cd ~/code/repo/judo/judoregister-web
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For JudoManager API (JM DATA v1) project run all commands one by one in following order:
cd ~/code/repo/judo/judoregister-api
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
IJF group
For IJF API (DATA v1) project run all commands one by one in following order:
cd ~/code/repo/judo/data
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For IJF APIs (DATA v2) project run all commands one by one in following order:
cd ~/code/repo/judo/apis
sudo service judo-apis stop
git pull --rebase
sudo service judo-apis start
IJF APIs (DATA v2) project has to be up and running. You will need NSwagStudio v13.20.0. NSwagStudio.msi can be downloaded from https://github.com/RicoSuter/NSwag/releases in order to generate Datav2Api.cs file. Run NSwagStudio v13.20.0 and load (File -> Open) proper nswag file. Then click "Generate Files" in bottom right corner (it takes ~ 10 seconds to finish).
Front-end project | nswag input file | Datav2Api.cs file |
---|---|---|
IJF Admin v2 | IjfAdmin/Client/IJFAdmin.nswag | IjfAdmin/Client/Datav2Api.cs |
IJF My | MyIJF/MyIJFBlazor/IJFMyDatav2.nswag | MyIJF/MyIJFBlazor/Datav2Api.cs |
For IJF CDN V3 project run all commands one by one in following order (note that IJF APIs project has to be up and running):
cd ~/code/repo/judo/apis/FilesV3CDN/filesV3CDN
git pull --rebase
Run pm2 ls
command to see if IJFCDNV3 is already running. In case it does not, first check if ngrok is running and if it is redirecting IJF APIs port 12321 (see Appendix for details). Edit wrangler.toml
(if it does not exists, copy it from sample.wrangler.toml
):
- account_id (replace "CLOUDFLARE-ACCOUNT-ID" with value from Bitwarden - CLOUDFLARE TEST FILESV3 ACCOUNT ID)
- APIV2_BASE_URL under [vars] (replace "YOUR-LOCAL-APIV2-BASE-URL" with _ngrok URL which can be found in
~/ngrok.log
; do not forget '/' at the end)
Run IJFCDNV3:
pm2 start npm --name "IJFCDNV3" -- run dev
In case IJFCDNV3 is already running:
pm2 restart [IJFCDNV3 ID]
To check log, run command:
pm2 log [IJFCDNV3 ID]
For IJF Account project run all commands one by one in following order:
cd ~/code/repo/judo/account
sudo service judo-account stop
git pull --rebase
sudo service judo-account start
For IJF Admin (JudoBase) project run all commands one by one in following order:
cd ~/code/repo/judo/admin
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For IJF Admin v2 project run all commands one by one in following order:
cd ~/code/repo/judo/adminv2
sudo service judo-adminv2 stop
git pull --rebase
sudo service judo-adminv2 start
For IJF WSRT project run all commands one by one in following order:
cd ~/code/repo/judo/ws_rt
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For IJF Live project run all commands one by one in following order:
cd ~/code/repo/judo/live
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
For IJF Tagger project run all commands one by one in following order:
cd ~/code/repo/judo/tagger
sudo docker-compose down
git pull --rebase
sudo docker-compose up -d
In case there is no front/assets/app/AppConfig.ts
file, run command:
cp front/assets/app/AppConfig.sample.ts front/assets/app/AppConfig.ts
And edit URLs in AppConfig.ts to link other projects (at local.datastat.si)
For IJF My project run all commands one by one in following order:
cd ~/code/repo/judo/my
sudo service judo-my stop
git pull --rebase
sudo service judo-my start
Internal tools
For Internal tools project run all commands one by one in following order (note that JudoManager API Sharp and IJF APIs (DATA v2) projects has to be up and running):
cd ~/code/repo/judo/internal-tools
git pull --rebase
pm2 ps
Check INTERNALTOOLS ID, insert it to "[INTERNALTOOLS ID], delete brackets and run command:
pm2 restart [INTERNALTOOLS ID]
To check log, run command:
pm2 log [INTERNALTOOLS ID]
Appendix
To check if ngrok is already running, run command:
ps -Af | grep ngrok
To run ngrok in background, run command:
ngrok http [port] --log=stdout > ~/ngrok.log &
then check ~/ngrok.log file for URL which is seen from outside.
To kill ngrok process, run command:
ps -Af | grep ngrok
kill [nkrog process ID]
Run all commands one by one in following order:
sudo service caddy stop
sudo service caddy start
First check which .NET SDKs and/or runtimes are installed:
dotnet --info
To install new .NET SDK version, run command:
sudo apt install dotnet-sdk-[major version e.g. 8.0]
OR run all commands one by one in following order:
mkdir -p $HOME/dotnet_install
cd $HOME/dotnet_install
wget https://dot.net/v1/dotnet-install.sh -O ./dotnet-install.sh
chmod +x ./dotnet-install.sh
sudo ./dotnet-install.sh --install-dir /usr/lib/dotnet --channel [major version e.g. 9.0]
- /etc/caddy/Caddyfile - file contains caddy settings; edit it when new project is added and restart caddy
- /etc/systemd/system - folder contains service files; create new one when new ASP.Net project is added
- Local JM API Sharp (swagger): https://judomanagersharp.local.datastat.si/swagger/index.html
- Local JM Account: https://judomanageraccount.local.datastat.si
- Local JM Portal: https://judomanagerportal.local.datastat.si
- Local JM Admin: https://judomanagerweb.local.datastat.si
- Local IJF APIs (swagger): https://ijfdatav2.local.datastat.si/swagger/index.html
- Local IJF Account: https://ijfaccount.local.datastat.si
- Local IJF Admin JudoBase: https://ijfadminjudobase.local.datastat.si
- Local IJF Admin v2: https://ijfadminv2.local.datastat.si
- Local IJF Live: https://ijflive.local.datastat.si
- Local IJF Tagger: https://ijftagger.local.datastat.si
- Local IJF My: https://ijfmy.local.datastat.si
- Local Internal tools: https://internaltools.local.datastat.si/