Skip to content

Commit 5d17512

Browse files
authored
Housekeeping from getting rfcbot running locally again (#280)
* sync .travis.yml rust version with rust-toolchain's * update users backup * remove target spec literal from travis config * Include DB setup in CONTRIBUTING.md, add script for full backup. * Create schema.rs with latest version of diesel_cli. * tell travis to install stable rust instead of our toolchain file * Update rust version, `cargo update`. * Fix diesel_cli installation command for use by cargo directly.
1 parent 0041dfa commit 5d17512

7 files changed

+7415
-3807
lines changed

.travis.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ dist: xenial
22
notifications:
33
email: false
44
language: rust
5-
rust:
6-
# sync in `rust-toolchain` file
7-
- nightly-2019-04-26
85
cache:
96
directories:
107
- "$HOME/.cargo"
@@ -33,9 +30,7 @@ install:
3330
- export DATABASE_URL=postgres://localhost/dashboard
3431
- export DATABASE_POOL_SIZE=5
3532
- rustup default $(cat rust-toolchain)
36-
- cargo install cargo-update || true
37-
- cargo install-update-config diesel_cli --default-features false --feature postgres
38-
- cargo install-update -i diesel_cli
33+
- cargo install diesel_cli --no-default-features --features postgres -Z install-upgrade
3934
before_script:
4035
- diesel setup
4136
- diesel migration run

CONTRIBUTING.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ https://devcenter.heroku.com/articles/heroku-cli
3838

3939
See config.rs for the environment variables expected. Also, rocket env vars are supported.
4040

41+
You can also create a [local `.env` file](https://github.com/dotenv-rs/dotenv#examples) which will
42+
be added to the environment variables the server sees.
43+
4144
### Database dumps
4245

4346
It can be useful to have a database with some existing data to start from. "Bootstrap" files are available at https://www.dropbox.com/sh/dl4pxj1d49ici1f/AAAzZQxWVqQzVk_zOksn0Rbya?dl=0. They usually are behind several migrations, so you'll still need to run the migrations if you start from one.
4447

48+
See [below](#database) for information about restoring from a bootstrap file.
49+
4550
### Running server processes
4651

4752
There are two daemons to run, one for the front-end development server, and one for the back-end API server and scraper. It's recommended to run these in two separate terminal windows/tabs/sessions.
@@ -81,14 +86,17 @@ Note that you can configure the Rocket web server using environment variables li
8186

8287
## Database
8388

84-
I'm testing with PostgreSQL 9.5. To init, make sure `DATABASE_URL` is set, and:
89+
To init, make sure `DATABASE_URL` is set and postgres is running, and:
8590

8691
```
8792
cargo install diesel_cli
88-
diesel migration run
93+
diesel setup
8994
diesel print-schema > src/domain/schema.rs
9095
```
9196

97+
If the database setup experiences errors, your user may not have permission to create databases or
98+
there may be other configuration problems.
99+
92100
That should have the database you've specified ready to receive data. Then you can run some of the bootstrapping commands (see below). Alternatively, you can use `bootstrap.sql` to get a nice starting point for the database (note that this isn't maintained regularly).
93101

94102
```bash

0 commit comments

Comments
 (0)