Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Makefile): Add checks to pip, pipenv, and PostgreSQL installations #44

Merged
merged 7 commits into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions examples/django-deployment/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
HOME_DIR = $(shell pwd)
USER_BIN_PATH = $(shell python3 -m site --user-base)/bin
PG_CONFIG_PATH = $(shell which pg_config)
PIP_PATH = $(shell which pip)

.PHONY: install
install:
Expand Down Expand Up @@ -33,7 +36,30 @@ compile-packages:

.PHONY: complete-install
complete-install:

ifeq (${PIP_PATH},)
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python ./get-pip.py
endif

ifeq (${PG_CONFIG_PATH},)
ifeq ($(shell uname -s), Linux)
apt-get -y install postgresql
else ifeq ($(shell uname -s), Darwin)
brew install postgresql
else
echo "Error! postgresql not supported by $(shell uname -s)"
exit 125
endif
endif

ifneq ($(shell pip list | grep pipenv | cut -d ' ' -f1),pipenv)
pip install --user pipenv
endif

export PATH=${PATH}:${USER_BIN_PATH} && \
make compile-packages && make install

ifeq ($(shell uname -s), Linux)
apt-get install redis
else ifeq ($(shell uname -s),Darwin)
Expand Down