- Install openjdk-21, when typing
java --versionin the terminal the output should beopenjdk 21 2023-09-19 - Install docker and docker compose
- Copy the
src/main/resources/application-dev.properties.examplefile tosrc/main/resources/application-dev.propertiesand adjust the values if needed docker compose up -dor (docker-compose up -d)- Visit http://localhost:5050 in your browser to check if the database is running (email: admin@admin.com, password: admin)
- On http://localhost:5050 connect to DB -> right click "Servers" -> "Register Server" -> "name" =
patient-app-postgres, "Host name/address" =patient-app-postgres, "Port" =5432, "Username" =patient-app-user, "Password" =patient-app-password, and "Save Password?" =Yes ./gradlew bootRun- Visit http://localhost:8080 -> it should say: "The application is running."
- To add a new non-secret environment variable, add it to the
application-dev.properties.example,application-dev.propertiesandapplication-prod.propertiesfiles in thesrc/main/resourcesfolder. - Additionally add the .env variables to the
.kubernetes/overlays/main/kustomization.yamland.kubernetes/overlays/production/kustomization.yamlfiles under the configMapGenerator section (for the main and production environments) - Add the new environment variable to the
src/main/java/ch/uzh/ifi/imrg/patientapp/utils/EnvironmentVariables.javafile so it can be easily accessed in the code
- To add a new non-secret environment variable, add it to the
application-dev.properties.example,application-dev.propertiesandapplication-prod.propertiesfiles in thesrc/main/resourcesfolder. - Additionally add the .env variable as a repository secret in Github under
Settings->Secrets and variables->New repository secret. - In the
.github/workflows/deploy.ymlfile under theRestart Kubernetes Deploymentssection add the new secret to env section and echo it to the kubernetes overlays file in the main environment (see current implementation for reference) - Add the new environment variable to the
src/main/java/ch/uzh/ifi/imrg/patientapp/utils/EnvironmentVariables.javafile so it can be easily accessed in the code
- The "main" environment shows the latest changes on the main branch
- https://backend-patient-app-main.jonas-blum.ch/
- The "uzh" environment shows the latest changes on the production branch
- https://vllm-imrg.ifi.uzh.ch/client-backend/
-
Look at the issue number and create a new branch (from main) with the name
issueNumber-issue-title(e.g.5-create-login-register-endpoint) -
Do some changes and add your first commit
-
As soon as you added the first commit, push the branch (so other team member are aware of your work and can already see if any problems might arise -> if everyone just codes by themselves the collaboration is usually a lot worse)
-
Create a pull request from your branch to main
-
Add the issue number to the pull request title (e.g.
5: Create login/register endpoint) -
In the description of the pull request, add
-closes #5to automatically close the issue when the pull request is merged -
Assign the pull request to yourself
-
After applying the file formatting take a look at the changes of the pull request in Github under "Files changed" to see that everything is correct
-
If everything is correct, merge the pull request with the option "Squash and merge" (so we have a nice history with one commit per issue -> otherwise the commit history is bloated with commits)
-
(Optional) If you cannot merge your branch into main due to a conflict do the following steps:
git checkout maingit pull(orgit reset --hard origin/mainif you have some local changes)git checkout YOUR-BRANCH(e.g.5-create-login-register-endpoint)git rebase -i main- Solve the conflicts with the help of your IDE
- Do a force push of your branch
git push -f - Now the conflicts should be solved and you can merge your branch into main through Github (with the option "Squash and merge")
git checkout maingit pull(orgit reset --hard origin/mainif you have some local changes)git push --force origin main:production