-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.txt
More file actions
47 lines (29 loc) · 2.36 KB
/
setup.txt
File metadata and controls
47 lines (29 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Instructions for getting web-cdi to work locally as of 3/16/18
Clone the repo
Ask for these files from current lab manager (not on Github) These files go in the webcdi/webcdi folder:
- databases.py
- secret_key.py
- email.py
- captcha.py
pip install -r requirements.txt
Install postgresql. The databases.py file will have the name of the user and database (locally and on prod / dev servers)
It may be difficult to rerun all migrations and get the schema working, so an alternative is to copy data from current dev database and import into your local db.
pg_dump -h [dev db hostname from databases.py] -p 5432 -U [db user] [db name] > file.sql
psql -h localhost -d [db name] -U [db user] -f file.sql
Once you have the data, and installed packages, you should be able to run the server:
./manage.py runserver --insecure
Working with postgres could be difficult. There are instructions online, as well as some legacy instructions in setup_OUTDATED.txt that may help.
**Deploy to Dev and Production**
In order to do this, you must ssh into the webcdi "base" instance, and from there deploy to the development or production servers. Here is the host info for the base server:
Host web-cdi
HostName 52.32.108.131
User ubuntu
IdentityFile ~/.ssh/web-cdi_011017.pem
NOTE: You will need to get the IdentifyFile from someone. (Alessandro and Henry have it - I do not know who else does).
You can now ssh into the webcdi base with `ssh -i ~/.ssh/web-cdi_011017.pem ubuntu@52.32.108.131`
Next, you will see two folders inside the home directory once you ssh: web-cdi and webcdi-backup. The first is the actual repo, so in order to update it you have to go in and pull the latest code, or change the branch. This is the repo that will be pushed to production or development. There is also a folder inside there called .ebextensions which contains important config files. One file in particular, `02_python.config`, has a list of python commands that are run on the actual production / dev server every time there is a deploy (e.g. django migration commands). You can add a python command here if you want to.
The second folder (webcdi-backup) contains the deploy script. In order to deploy to prod, you run:
`bash eb_deploy.sh web-cdi-prod2`
and to deploy to dev you run:
`bash eb_deploy.sh web-cdi-dev`
To access admin you will need to obtain an admin username and password from a current admin user.