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

Setting up Gitpod for development #67

Open
wants to merge 22 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7adae64
Adding initial gitpod setup
zack-overflow Nov 29, 2022
c14fcf9
remove installation of unspecified "tool" from dockerfile
zack-overflow Nov 29, 2022
a8f068e
Adding installation of python 2.7.16 to gitpod.yml
zack-overflow Nov 29, 2022
2fb1524
Adding to gitpod config
zack-overflow Dec 2, 2022
132a5db
changes to fix for current term
zack-overflow Dec 2, 2022
fa9f9f6
Comment out the "command" part of gitpod startup
zack-overflow Dec 12, 2022
3d24070
remove more parts from gitpod.yml because .env file is hard to create…
zack-overflow Dec 12, 2022
075a5e6
Name terminal for dev env setup
zack-overflow Dec 12, 2022
37cd41e
removing commented parts of gitpod.yml
zack-overflow Dec 12, 2022
7ada834
Changes to gitpod.yml to remove double start of postgres
zack-overflow Dec 12, 2022
924b329
Adding popsql ip addresses to allowed hosts for postgres
zack-overflow Dec 12, 2022
0394732
Merge branch 'zsg/term-updates' into gitpod
zack-overflow Dec 12, 2022
6adde18
update to try to get postgres working with gitpod
zack-overflow Dec 12, 2022
c4536cb
Moving commands to before section in gitpod.yml
zack-overflow Dec 12, 2022
b0b3123
Adding * to allowed hosts in debug mode
zack-overflow Dec 12, 2022
8e30f15
moving commands to init and turning off prebuilds
zack-overflow Dec 16, 2022
8149486
removing redundant call to venv activate
zack-overflow Dec 16, 2022
a8d6a0d
Remove call to environment.sh
zack-overflow Dec 16, 2022
f1c5b09
Moving more gitpod.yml commands to before task
zack-overflow Dec 16, 2022
5dc3959
Moving installation of python 2.7.16 to init task
zack-overflow Dec 16, 2022
04ca1ab
Add Gitpod info to Contributing.md
zack-overflow Dec 16, 2022
62dd150
Reverting some change unrelated to Gitpod
zack-overflow Dec 16, 2022
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
5 changes: 5 additions & 0 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gitpod/workspace-postgresql

RUN sudo install-packages postgresql-12 postgresql-contrib-12
RUN sudo apt-get update \
&& sudo rm -rf /var/lib/apt/lists/*
59 changes: 59 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# the gitpod-provided dockerfile provides the deafult gitpod environment with the addition of Postgres
image:
file: .gitpod.dockerfile

tasks:
- name: LL terminal
before: |
gp env > .env
eval $(gp env -e)
brew tap heroku/brew && brew install heroku
brew install redis
brew install forego
npm install -g yuglify
init: |
pyenv install 2.7.16
pip install virtualenv
virtualenv venv --python=python2.7
createdb layuplist
source ./scripts/dev/virtualize.sh
pip install -r requirements.txt
python manage.py migrate
command: |
source ./scripts/dev/virtualize.sh
python manage.py collectstatic
redis-server &
forego start




ports:
- port: 5000
onOpen: open-preview
name: website
description: Website Preview



vscode:
extensions:
- ms-python.python
- eamodio.gitlens

github:
prebuilds:
# enable for the default branch (defaults to true)
master: false
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: false
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: false
# add a check to pull requests (defaults to true)
addCheck: false
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: false
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.16
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ To contribute code, make a pull request. Github has a great <a href="https://gui

Feel free to email <a href="mailto:[email protected]">[email protected]</a> if you need any help.

Pre-configured Development Environment (Gitpod)
-----------------
Layup List has a number of old dependencies and technologies and uses python 2.7.16, [which is deprecated](https://github.com/layuplist/layup-list/issues/62) as its main language. These factors can make setting up a local development for Layup List a little precarious and often frustrating.

Therefore, we have set up a pre-configured development environment for new Layup List contributors using [Gitpod](https://www.gitpod.io/). Developers can make a free Gitpod account and get 50 hours of development time per month for no cost. Even better, students can receive a free upgrade to a Gitpod "personal" plan with the [Github student developer pack](https://education.github.com/pack) to get another 50 hours free.

**To set up your Gitpod account to work with Layup List, see [this Wiki](https://github.com/zack-overflow/layup-list/wiki/Developing-for-Layup-List-with-Gitpod)!**

If you prefer to set up your own local development environment, follow the instructions below.

Local Setup (macOS or OS X)
-----------------
#### Installation
Expand Down
2 changes: 1 addition & 1 deletion layup_list/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = os.environ['DEBUG'] == "True"
ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost']
ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost', '23.20.131.72', '54.211.234.135', '*']
AUTO_IMPORT_CRAWLED_DATA = os.environ.get('AUTO_IMPORT_CRAWLED_DATA') == "True"

INSTALLED_APPS = [
Expand Down