My simple application just to try Github Actions features
-
Install JDK 21 and set correctly JAVA_HOME to that JDK
-
Set up a MySQL database with a specific database name, user and password.
-
Copy the
setEnvfile removing the ".fake" suffix with the following commands:On Linux
cd local/scripts cp setEnv.sh.fake setEnv.shOn Windows
cd local/scripts copy setEnv.bat.fake setEnv.bat -
Set database related variables according to your database with the following commands::
On Linux (example if you want to set
MYSQLUSER,MYSQLPASSWORDandMYSQLDATABASEas values)sed -i 's/<<set mysql name variable value>>/MYSQLUSER/g' setEnv.sh sed -i 's/<<set mysql password variable value>>/MYSQLPASSWORD/g' setEnv.sh sed -i 's/<<set mysql database variable value>>/MYSQLDATABASE/g' setEnv.shOn Windows (example if you want to set
MYSQLUSER,MYSQLPASSWORDandMYSQLDATABASEas values)powershell -Command "(Get-Content setEnv.bat) -replace '<<set mysql name variable value>>', 'MYSQLUSER' | Set-Content setEnv.bat" powershell -Command "(Get-Content setEnv.bat) -replace '<<set mysql password variable value>>', 'MYSQLPASSWORD' | Set-Content setEnv.bat" powershell -Command "(Get-Content setEnv.bat) -replace '<<set mysql database variable value>>', 'MYSQLDATABASE' | Set-Content setEnv.bat" -
Run the script to actually set those variable values then go back to the root with the following command
On Linux
source setEnv.sh cd ../..On Windows
setEnv.bat cd ../.. -
Run the SpringBoot application using the local profile
On Linux
cd backend ./mvnw spring-boot:run -Dspring-boot.run.profiles=localOn Windows
cd backend mvnw.cmd spring-boot:run -Dspring-boot.run.profiles=local -
Run the Angular application
cd frontend npm run serve:local -
In a browser access localhost:4300/browser
To run the application locally with Docker Compose, you need to set up the required MySQL environment variables:
-
Copy the
.env.fakeremoving the ".fake" suffix with the following commands:On Linux
cd docker cp .env.fake .envOn Windows
cd docker copy .env.fake .env -
Set database related variables according to your database with the following commands::
On Linux (example if you want to set
MYSQL_ROOT_PASSWORD,MYSQLUSER,MYSQLPASSWORDandMYSQLDATABASEas values)sed -i 's/<<set mysql root passoword variable value>>/MYSQL_ROOT_PASSWORD/g' .env sed -i 's/<<set mysql name variable value>>/MYSQLUSER/g' .env sed -i 's/<<set mysql password variable value>>/MYSQLPASSWORD/g' .env sed -i 's/<<set mysql database variable value>>/MYSQLDATABASE/g' .envOn Windows (example if you want to set
MYSQL_ROOT_PASSWORD,MYSQLUSER,MYSQLPASSWORDandMYSQLDATABASEas values)powershell -Command "(Get-Content .env) -replace '<<set mysql root password variable value>>', 'MYSQL_ROOT_PASSWORD' | Set-Content .env" powershell -Command "(Get-Content .env) -replace '<<set mysql name variable value>>', 'MYSQLUSER' | Set-Content .env" powershell -Command "(Get-Content .env) -replace '<<set mysql password variable value>>', 'MYSQLPASSWORD' | Set-Content .env" powershell -Command "(Get-Content .env) -replace '<<set mysql database variable value>>', 'MYSQLDATABASE' | Set-Content .env" -
Run the docker compose
docker-compose up -d -
In a browser access localhost:4300/browser