You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use our configuration to launch a new Heroku app using [Heroku's app-setups api](https://devcenter.heroku.com/articles/setting-up-apps-using-the-heroku-platform-api).
9
+
10
+
You'll have to set some env settings. Peek at [app.json](app.json) for any env vars that don't have `"required": false` set. Our config vars are covered in [Configure section](#configure)
11
+
12
+
13
+
Create The App: **MAKE SURE you modify the env values**
14
+
15
+
```
16
+
curl -n -X POST https://api.heroku.com/app-setups \
Read the result to make sure it returned an id, not an error.
26
+
27
+
Check your Heroku dashboard or run `heroku apps` to see if a new app shows up. If all goes well, it should be running.
2
28
3
-
1.`git clone git@github.com:ucfcdl/UDOIT.git` to grab a copy of the git repo
4
-
2.`heroku create` will set up a Heroku project
5
-
3.`heroku addons:create heroku-postgresql:hobby-dev` add a database addon
6
-
4.`heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi` may be required
7
-
5.`git push heroku master:master` will build build the server using our master branch
8
-
6. set up the Heroku config variables below
9
29
10
30
## Configure
11
-
Set Heroku config variables using `heroku config:set VAR=value1`
31
+
These variables can be set in the curl post above. You can also set them later using `heroku config:set VAR=value1`
12
32
13
33
*`CONSUMER_KEY` - LTI consumer key entered when adding UDOIT LTI to Canvas
14
34
*`SHARED_SECRET` - LTI secret entered when adding UDOIT LTI to Canvas
@@ -18,34 +38,38 @@ Set Heroku config variables using `heroku config:set VAR=value1`
18
38
*`GOOGLE_API_KEY` - add a google api key for youtube video support
19
39
*`USE_HEROKU_CONFIG` - set to `true` to enable the Heroku configuration
20
40
21
-
## Create Database Tables
22
-
You'll need to have postgresql installed on your own system to connect to the Heroku postgresql database.
41
+
# Develop using Heroku
42
+
43
+
To modify the code on your running Heroku server, you'll need to push code to it.
44
+
45
+
Set up the git repository:
46
+
```
47
+
git clone git@github.com:ucfopen/UDOIT.git
48
+
cd UDOIT
49
+
```
50
+
51
+
Link the git repository to your Heroku App
52
+
```
53
+
heroku git:remote --app <YOUR_HEROKU_APP_NAME>
54
+
```
55
+
56
+
Build and Deploy
57
+
```
58
+
git push heroku master:master
59
+
```
60
+
61
+
## Peeking at Database Tables
62
+
The Heroku install process should create the tables for you.
63
+
64
+
If you need to check that the tables exist, you can connect to Postgres using some convenient Heroku functions. You'll need to have **Postgresql installed on your own system** to do the following commands.
23
65
24
66
*`heroku pg:psql` will open a psql connection to the remote Heroku database
25
-
* copy and paste the postgresql table schemeas for the users and reports table into the prompt
26
67
*`\dt` will show you a list of the tables you just created
68
+
*`\d reports` and `\d users` should describe the tables
69
+
*`Select * from users;` or `Select * from reports;` will show you their contents
27
70
*`\q` quits the psql terminal
28
71
29
-
```sql
30
-
/* postgresql */
31
-
CREATETABLEreports (
32
-
id SERIALPRIMARY KEY,
33
-
user_id integer,
34
-
course_id integer,
35
-
file_path text,
36
-
date_run timestamp with time zone,
37
-
errors integer,
38
-
suggestions integer
39
-
);
40
-
```
41
-
42
-
### Users Table
43
-
44
-
```sql
45
-
/* postgresql */
46
-
CREATETABLEusers (
47
-
id integerCONSTRAINT users_pk PRIMARY KEY,
48
-
api_key varchar(255),
49
-
date_created integer
50
-
);
51
-
```
72
+
If needed, you can manually run the table creation script: `Heroku run php lib/db_create_tables.php`
73
+
74
+
## Table Schema
75
+
The table schema can be found in [lib/db_create_tables.php](lib/db_create_tables.php)
0 commit comments