docs: update README.md; add run script
This commit is contained in:
parent
78780d6762
commit
23124e35b9
24
README.md
24
README.md
@ -4,35 +4,35 @@
|
|||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
1. Compile the project (`[~]$ dotnet build -c Release` or in IDE)
|
To build and then run compiled project use `[~]$ sh run.sh`
|
||||||
2. Copy ~/TicketOffice/wwwroot to the root directory of compiled project (clean database can be found in ~/wwwroot/db)
|
|
||||||
3. Launch
|
|
||||||
|
|
||||||
### Database update
|
### Security
|
||||||
|
|
||||||
1. `[~/TicketOffice]$ dotnet-ef database drop` then confirm database deletion
|
The program is build for educational purposes and will not be use in the production.
|
||||||
2. `[~/TicketOffice]$ dotnet-ef database update`
|
But if you want to host this web app be shure to comment/delete 30'th line in Program.cs/
|
||||||
|
|
||||||
### Available routes
|
### Miscellaneous
|
||||||
|
|
||||||
#### № 027
|
#### Available routes
|
||||||
|
|
||||||
|
##### № 027
|
||||||
|
|
||||||
- Сватове -> Красноріченське -> Кремінна -> Рубіжне -> Сєвєродонецьк -> Лисичанськ -> Сєвєродонецьк -> Рубіжне -> Кремінна -> Красноріченське -> Сватове
|
- Сватове -> Красноріченське -> Кремінна -> Рубіжне -> Сєвєродонецьк -> Лисичанськ -> Сєвєродонецьк -> Рубіжне -> Кремінна -> Красноріченське -> Сватове
|
||||||
- (Date: date of the first launch of project with clean database)
|
- (Date: date of the first launch of project with clean database)
|
||||||
|
|
||||||
#### № 013
|
##### № 013
|
||||||
|
|
||||||
- Кремінна -> Рубіжне -> Сєвєродонецьк -> Станиця Луганська -> Сєвєродонецьк -> Рубіжне -> Кремінна
|
- Кремінна -> Рубіжне -> Сєвєродонецьк -> Станиця Луганська -> Сєвєродонецьк -> Рубіжне -> Кремінна
|
||||||
- (Date: date of the first launch of project with clean database)
|
- (Date: date of the first launch of project with clean database)
|
||||||
|
|
||||||
### Test accounts
|
#### Test accounts
|
||||||
|
|
||||||
#### User
|
##### User
|
||||||
|
|
||||||
- e-mail: user
|
- e-mail: user
|
||||||
- password: user
|
- password: user
|
||||||
|
|
||||||
#### Admin
|
##### Admin
|
||||||
|
|
||||||
- e-mail: admin
|
- e-mail: admin
|
||||||
- password: admin
|
- password: admin
|
||||||
|
89
run.sh
Executable file
89
run.sh
Executable file
@ -0,0 +1,89 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function Build() {
|
||||||
|
echo ""
|
||||||
|
echo " This is your first run of the project"
|
||||||
|
echo " Compiling..."
|
||||||
|
echo ""
|
||||||
|
dotnet build --configuration Release --nologo --verbosity q
|
||||||
|
chmod +x ./TicketOffice/bin/Release/net6.0/TicketOffice
|
||||||
|
cp -r ./TicketOffice/wwwroot/ ./TicketOffice/bin/Release/net6.0/
|
||||||
|
echo ""
|
||||||
|
echo " Project compiled."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function RenewDatabase() {
|
||||||
|
echo ""
|
||||||
|
echo " Renewing the database..."
|
||||||
|
echo ""
|
||||||
|
dotnet-ef database drop -f --project ./TicketOffice/
|
||||||
|
dotnet-ef database update --project ./TicketOffice/
|
||||||
|
yes | cp ./TicketOffice/wwwroot/db/TicketOffice-SQLite.db ./TicketOffice/bin/Release/net6.0/wwwroot/db/
|
||||||
|
echo ""
|
||||||
|
echo " Database renewed."
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function Start() {
|
||||||
|
echo ""
|
||||||
|
echo " Starting..."
|
||||||
|
echo ""
|
||||||
|
cd ./TicketOffice/bin/Release/net6.0/
|
||||||
|
./TicketOffice
|
||||||
|
}
|
||||||
|
|
||||||
|
function RunScript() {
|
||||||
|
str=$(ls ./TicketOffice/bin | grep Release)
|
||||||
|
|
||||||
|
if [ -z "$str" ]
|
||||||
|
then
|
||||||
|
Build
|
||||||
|
echo ""
|
||||||
|
echo " Copying essential files..."
|
||||||
|
echo ""
|
||||||
|
cp ./TicketOffice/wwwroot/ ./TicketOffice/bin/Release/net6.0/ -r
|
||||||
|
echo ""
|
||||||
|
echo " Files copied."
|
||||||
|
echo ""
|
||||||
|
RenewDatabase
|
||||||
|
Start
|
||||||
|
else
|
||||||
|
Start
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# = 0 ]
|
||||||
|
then
|
||||||
|
RunScript
|
||||||
|
elif [ $1 = "--renew" ]
|
||||||
|
then
|
||||||
|
RenewDatabase
|
||||||
|
Start
|
||||||
|
exit 0
|
||||||
|
elif [ $1 = "--rebuild" ]
|
||||||
|
then
|
||||||
|
echo ""
|
||||||
|
echo " Deleting compiled project..."
|
||||||
|
echo ""
|
||||||
|
rm -Rf ./TicketOffice/bin/Release
|
||||||
|
echo ""
|
||||||
|
echo " Deletion complete."
|
||||||
|
echo ""
|
||||||
|
Build
|
||||||
|
Start
|
||||||
|
exit 0
|
||||||
|
elif [ $1 = "--help" ]
|
||||||
|
then
|
||||||
|
echo ""
|
||||||
|
echo " Available options:"
|
||||||
|
echo " --renew renew the database"
|
||||||
|
echo " --rebuild rebuild the project"
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
elif [ -n "$1" ]
|
||||||
|
then
|
||||||
|
echo "$0: unrecognized option '$1'"
|
||||||
|
echo "Try '$0 --help' for more information."
|
||||||
|
exit 0
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user