-
Notifications
You must be signed in to change notification settings - Fork 55
Create Makefile #534
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
Merged
kjaymiller
merged 2 commits into
BlackPythonDevs:gh-pages
from
Kabasitad:create-makefile
Oct 22, 2024
+84
β1
Merged
Create Makefile #534
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.2.2 | ||
3.3.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Makefile for managing Jekyll project for BlackPythonDev | ||
|
||
# Set up the environment by pulling the latest Ruby build definitions, installing Ruby 3.3.5, | ||
# as seen in the .ruby-version file, installing required gems and Python packages, | ||
# and configuring pre-commit hooks | ||
|
||
.PHONY: setup-ruby setup-python install | ||
|
||
|
||
install: setup-ruby setup-python | ||
|
||
# Install the necessary Ruby gems defined in the Gemfile | ||
- bundle install | ||
|
||
# Install Python dependencies defined in requirements-dev.txt | ||
- pip install -r requirements-dev.txt | ||
|
||
# Set up pre-commit hooks as defined in the configuration file | ||
- pre-commit install | ||
|
||
|
||
setup-ruby: | ||
# Pull the latest ruby-build plugin updates | ||
- git -C /root/.rbenv/plugins/ruby-build pull | ||
|
||
# Install Ruby version 3.3.5 using rbenv | ||
- rbenv install 3.3.5 | ||
|
||
# Set local version of ruby to 3.3.5 | ||
- rbenv local 3.3.5 | ||
|
||
|
||
setup-python: | ||
# System Build Dependencies for pyenv | ||
- sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \ | ||
libbz2-dev libreadline-dev libsqlite3-dev wget curl libncurses5-dev \ | ||
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev | ||
|
||
# Install Pyenv | ||
- curl https://pyenv.run | bash | ||
|
||
# Add Pyenv to Environment | ||
@echo "Setting up pyenv in ~/.bash_profile, ~/.profile, and ~/.bashrc..." | ||
@if [ -f $$HOME/.bash_profile ]; then \ | ||
echo "Appending to ~/.bash_profile"; \ | ||
grep -qxF 'export PYENV_ROOT="$$HOME/.pyenv"' $$HOME/.bash_profile || echo 'export PYENV_ROOT="$$HOME/.pyenv"' >> $$HOME/.bash_profile; \ | ||
grep -qxF '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' $$HOME/.bash_profile || echo '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' >> $$HOME/.bash_profile; \ | ||
grep -qxF 'eval "$$(pyenv init -)"' $$HOME/.bash_profile || echo 'eval "$$(pyenv init -)"' >> $$HOME/.bash_profile; \ | ||
else \ | ||
echo "Appending to ~/.profile"; \ | ||
grep -qxF 'export PYENV_ROOT="$$HOME/.pyenv"' $$HOME/.profile || echo 'export PYENV_ROOT="$$HOME/.pyenv"' >> $$HOME/.profile; \ | ||
grep -qxF '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' $$HOME/.profile || echo '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' >> $$HOME/.profile; \ | ||
grep -qxF 'eval "$$(pyenv init -)"' $$HOME/.profile || echo 'eval "$$(pyenv init -)"' >> $$HOME/.profile; \ | ||
fi | ||
|
||
# Append to ~/.bashrc for interactive shells | ||
@echo "Appending to ~/.bashrc" | ||
@grep -qxF 'export PYENV_ROOT="$$HOME/.pyenv"' $$HOME/.bashrc || echo 'export PYENV_ROOT="$$HOME/.pyenv"' >> $$HOME/.bashrc | ||
@grep -qxF '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' $$HOME/.bashrc || echo '[[ -d $$PYENV_ROOT/bin ]] && export PATH="$$PYENV_ROOT/bin:$$PATH"' >> $$HOME/.bashrc | ||
@grep -qxF 'eval "$$(pyenv init -)"' $$HOME/.bashrc || echo 'eval "$$(pyenv init -)"' >> $$HOME/.bashrc | ||
|
||
@echo "Pyenv setup completed." | ||
|
||
# Install Python version | ||
- pyenv install 3.11.7 | ||
|
||
# Set local python to 3.11.7 | ||
- pyenv local 3.11.7 | ||
|
||
|
||
# Start the Jekyll development server | ||
start: | ||
bundle exec jekyll serve | ||
|
||
|
||
# Start the Jekyll server in detached mode (runs in the background) | ||
start-detach: | ||
bundle exec jekyll serve --detach | ||
|
||
|
||
# Stop the detached Jekyll server (Kill the background Jekyll process) | ||
stop-detach: | ||
pkill -f jekyll |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What version of Python should be installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.11.7 will be installed, i have modified the file to reflect this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjaymiller Kindly review the PR again as she has made the changes requested.