Skip to content

Commit

Permalink
Merge pull request #26 from stevebrownlee/develop
Browse files Browse the repository at this point in the history
Release: Updated install scripts
  • Loading branch information
stevebrownlee authored Oct 1, 2024
2 parents f6a7033 + c043eff commit 006bade
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ This project is the API for the Learning Platform. It is a Django project using

## Prerequisites

### Learning Platform Request Collection

1. Install Postman
1. Open Postman app
1. Click File > Import from the navbar
2. Drag the `LearnOps.postman_collection.json` file into the dialog
4. Requests will be imported and should appear on the left.

### Windows Developer Prerequisites

If you are a Windows user, you will need to install WSL and Ubuntu.
Expand Down Expand Up @@ -94,9 +102,14 @@ In your terminal, be in the project directory, and run the following command.

Once this script is complete, you will have the Postgres database, and some starter data seeded in it.


## Start Virtual Environment

In the project directory, run `pipenv shell` to activate the VE for the project.
The setup script installs Python 3.9.1, so your last step is to start the virtual environment for the project with the correct version.

```sh
pipenv --python 3.9.1 shell
```

## Using the API

Expand Down
6 changes: 4 additions & 2 deletions setup_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
source ./setup_mac_python.sh
source ./setup_mac_data.sh

code --install-extension irongeek.vscode-env --force
code --install-extension ms-python.python --force
code --install-extension ms-python.vscode-pylance --force
code --install-extension njpwerner.autodocstring --force
code --install-extension alexcvzz.vscode-sqlite --force
code --install-extension streetsidesoftware.code-spell-checker --force
code --install-extension irongeek.vscode-env --force
code --install-extension ms-vscode-remote.remote-wsl --force
code --install-extension ms-python.pylint --force
code --install-extension ms-python.black-formatter --force
7 changes: 5 additions & 2 deletions setup_mac_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
PYTHON_VERSION=3.9.1

function installPyenv() {
# If changes need to be made to user's config file, detect the correct one
[[ "$SHELL" == *"bash"* ]] && config_file=".bashrc" || config_file=".zshrc"

if [ $(brew list | grep -c pyenv) != 1 ]; then
echo "Installing Pyenv"
brew install pyenv
Expand All @@ -23,8 +26,8 @@ export PATH=$HOME/.local/bin:$HOME/.pyenv/bin:$PATH
if command -v pyenv 1>/dev/null 2>&1; then
export PATH=$(pyenv root)/shims:$PATH
eval "$(pyenv init -)"\n
fi" >>$HOME/.zshrc
source $HOME/.zshrc
fi" >>$HOME/$config_file
source $HOME/$config_file
fi
}

Expand Down
21 changes: 20 additions & 1 deletion setup_ubuntu_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
source .env

# If changes need to be made to user's config file, detect the correct one
[[ $0 == *bash ]] && config_file=".bashrc" || config_file=".zshrc"
[[ "$SHELL" == *"bash"* ]] && config_file=".bashrc" || config_file=".zshrc"

manage_service() {
local service=$1
Expand Down Expand Up @@ -74,6 +74,17 @@ psql -c "GRANT ALL PRIVILEGES ON DATABASE $LEARN_OPS_DB TO $LEARN_OPS_USER;"
psql -c "GRANT ALL PRIVILEGES ON SCHEMA public TO $LEARN_OPS_USER;"
COMMANDS

# Install Node - Needs to be below zsh set up because of the shell environment
if ! command -v nvm &> /dev/null; then
echo -e "Installing Node Version Manager..."

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.zshrc &>zsh-reload.log
fi

nvm install --lts
nvm use --lts

#####
# Install Pyenv and required Python version
#####
Expand Down Expand Up @@ -216,3 +227,11 @@ sudo rm -f ./LearningAPI/fixtures/superuser.json
sudo rm -f ./LearningAPI/fixtures/socialaccount.json

echo "LEARNING_GITHUB_CALLBACK=http://localhost:3000/auth/github" >>.env

code --install-extension ms-python.python --force
code --install-extension ms-python.vscode-pylance --force
code --install-extension njpwerner.autodocstring --force
code --install-extension streetsidesoftware.code-spell-checker --force
code --install-extension ms-vscode-remote.remote-wsl --force
code --install-extension ms-python.pylint --force
code --install-extension ms-python.black-formatter --force

0 comments on commit 006bade

Please sign in to comment.