Skip to content

Commit

Permalink
updated the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel.Johnson committed Aug 29, 2024
1 parent 25abee2 commit 32ce1ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

If you need to run the app on another port `--port` can be used. To run in debug mode `--debug` can be used

```uvicorn main:app --port=7000 --debug```
```uvicorn main:app --port=7000 --debug --reload```

### Access Documentations

Expand Down
31 changes: 4 additions & 27 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACTIVATE_VENV := . $(ENVPATH)/bin/activate &&

SHELL := /bin/bash

.PHONY: pre-requistite venv-configure venv-activate install-dependencies check-package environmental-variables installing-docker kratosconfig
.PHONY: pre-requistite venv-configure venv-activate install-dependencies check-package environmental-variables installing-docker run-app

pre-requisite: #basic python packages to run the makefile
@if ! dpkg -s python3-pip &> /dev/null; then \
Expand Down Expand Up @@ -45,22 +45,6 @@ check-package: ## Check if packages from requirements.txt are installed
echo "Some packages are missing or failed to install."; \
fi

installing-psql:
@if psql --version | grep -q "15.3"; then \
echo "You already have psql 15.3 installed."; \
else \
read -p "You currently have a different version of psql installed. Do you want to proceed with installing psql 15.3? (y/N) " response; \
if [[ $$response =~ ^[Yy]$$ ]]; then \
echo "Installing psql 15.3..."; \
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'; \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null; \
sudo apt update; \
sudo apt remove postgresql postgresql-contrib; \
sudo apt install postgresql-15 postgresql-contrib-15; \
else \
echo "Aborted installation."; \
fi; \
fi

installing-psql:
@if psql --version | grep -q "15.3"; then \
Expand Down Expand Up @@ -113,10 +97,8 @@ installing-docker:
fi \
fi



kratosconfig:
cd docker/Kratos_config && sudo docker compose -f quickstart.yml up
run-app:
cd app && uvicorn main:app --port=7000 --debug --reload


setup:
Expand All @@ -129,9 +111,4 @@ setup:
make installing-psql
make environmental-variables
make installing-docker
make kratosconfig





make run-app
2 changes: 1 addition & 1 deletion makefile_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- installing-psql:: Checks if PostgreSQL version 15.3 is installed. If not, it prompts the user to install it and then installs it using sudo apt install.
- environmental-variables:: Makes a script named setup.sh executable and then runs it. This script likely sets certain environment variables needed for the project.
- installing-docker:: Checks if Docker version 24.0.1 or above is installed. If not, it prompts the user to install it and then installs it using the official Docker repository.
- kratosconfig:: Navigates to the docker/Kratos_config folder and runs docker compose -f quickstart.yml up to start Docker containers for the project.
- run-app:: Navigates to the cd app folder and runs uvicorn main:app --port=7000 --debug --reload to start the app

## Default Target:

Expand Down

0 comments on commit 32ce1ae

Please sign in to comment.