Browse Source

choret: update install process to make easier to get started (#70)

* Use default docker-machine IP address

* Add lockfile.

* Add fixtures

* Update readme

* Update install instructions.
master
Drew Larson 7 years ago
committed by GitHub
parent
commit
6bc0826f48
  1. 53
      README.md
  2. 4
      bikeshop_project/bikeshop/settings/development.py
  3. 51
      bikeshop_project/fixtures.yaml
  4. 7659
      bikeshop_project/package-lock.json
  5. 4
      bikeshop_project/webpack.dev.config.js

53
README.md

@ -1,42 +1,19 @@
## Quickstart
Maybe this isn't such a quick start, but it's the best I have right now. After the following steps are completed, you will have a working development version of the Trailer-Safeguard Django application connectable on [bikeshop-dev.local:8000/](http://bikeshop-dev.local:8000/).
# Workstand
1. Make sure Virtualbox is installed and updated ([https://www.virtualbox.org/](https://www.virtualbox.org/))
2. Make sure Vagrant is installed and updated ([https://www.vagrantup.com/](https://www.vagrantup.com/))
3. Verify *pip* is installed `which pip` (eg. using [http://brew.sh/](homebrew) `brew install pip`)
4. Verify *ansible* is installed `which ansible` (eg. using [http://brew.sh/](homebrew) `brew install ansible`)
5. 4. Verify *bower* is installed `which ansible` (eg. using [http://brew.sh/](homebrew) `brew install bower`)
5. Clone source `git clone AHHHHHH`
6. cd to root of repo & `bower install`
6. `ansible-galaxy install zenoamaro.postgresql -p provision/roles`
7. `vagrant plugin install vagrant-hostsupdater`
8. `vagrant up`
9. `vagrant ssh`
10. `cd /srv/bikeshop && . /opt/venv/bikeshop-development/bin/activate`
11. `./manage.py migrate`
12. `./manage.py loaddata core/migrations/initial_data.yaml && ./manage.py loaddata authentication/migrations/initial_data.yaml`
13. try to load [http://bikeshop.local/](http://bikeshop.local/)
13. may need to restart supervisor on vagrant machine `service supervisor restart` if receiving 502
## Quick start
### Example of dumpdata command
./manage.py dumpdata --exclude=auth --exclude=contenttypes --exclude=incoming --format=yaml
1. `$ git clone git@github.com:BridgeCityBicycleCoop/workstand.git`
2. `$ cd workstand/bikeshop_project`
3. `$ npm install`
4. `$ docker-machine start && eval $(docker-machine env)`
5. `$ cd .. && docker-compose -f docker-compose.yml -f docker-compose.dev.yml build`
6. `$ docker-compose -f docker-compose.yml -f docker-compose.dev.yml run workstand python manage.py migrate`
7. `$ docker-compose -f docker-compose.yml -f docker-compose.dev.yml run workstand python manage.py loaddata fixtures.yaml`
8. `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d`
9. Visit http://192.168.99.100:8000/ (`docker-machine ls` to see IP address)
10. Login with `u: admin@workstand.dev`and `p: bike!bike!`
### Reset the Postgres DB
1. `vagrant ssh`
2. `sudo -i -u postgres`
3. `psql`
4. `\c trailersafeguard_development`
5. ```
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
COMMENT ON SCHEMA public IS 'standard public schema';
```
6. Steps 11 and 12 from **Quickstart**.
**Requirements**
### Starting & Stopping Application
1. cd to root of repo
2. `vagrant up`
3. try to load [http://bikeshop.local/](http://bikeshop.local/)
5. `vagrant halt`
1. Docker, Docker Compose and Docker Machine
2. Node and NPM

4
bikeshop_project/bikeshop/settings/development.py

@ -9,8 +9,6 @@ SECRET_KEY = ')8(+b48*njk+e^8-l!6s3k4d=z(#g$v=)i^=_p-l*#-kk=!v_d'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Covers regular testing and django-coverage
if 'test' in sys.argv or 'test_coverage' in sys.argv:
DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3' # noqa
@ -53,7 +51,7 @@ MIDDLEWARE_CLASSES.insert(0, 'django.middleware.common.CommonMiddleware') # noq
CORS_ORIGIN_ALLOW_ALL = True
ALLOWED_HOSTS = ['workstand.docker', 'localhost']
ALLOWED_HOSTS = ['workstand.docker', 'localhost', '192.168.99.100']
MAILCHIMP_API_KEY = os.environ.get('MAILCHIMP_API_KEY')
MAILCHIMP_USERNAME = 'drew@bcbc.bike'

51
bikeshop_project/fixtures.yaml

@ -0,0 +1,51 @@
- model: registration.customuser
pk: 1
fields:
password: pbkdf2_sha256$36000$jinrcAwK8S8f$XJ1bBWrm55pertXDA07t5Htv7I1W4tnXSM9FKNYNaAA=
last_login: 2017-08-31 00:31:06.279698+00:00
is_superuser: true
email: admin@workstand.dev
is_admin: true
is_active: true
groups: []
user_permissions: []
- model: registration.member
pk: 1
fields: {user: null, email: felicia@bikesrgreat.com, email_consent: true, first_name: Felicia,
last_name: Garcia, preferred_name: null, date_of_birth: null, guardian_name: null,
phone: null, street: null, city: null, province: null, country: null, post_code: H0H
0H0, waiver: ! '2017-08-31 00:36:08.645982+00:00', is_active: true, notes: '',
suspended: false, banned: false, created_at: ! '2017-08-31 00:36:08.646610+00:00',
modified_at: ! '2017-08-31 00:36:08.646657+00:00', involvement: '21cd9799b6,c96d389517'}
- model: registration.member
pk: 2
fields: {user: null, email: floyd.davis@example.com, email_consent: true, first_name: Floyd,
last_name: Davis, preferred_name: null, date_of_birth: null, guardian_name: null,
phone: null, street: null, city: null, province: null, country: null, post_code: H0H
0H0, waiver: ! '2017-08-31 00:37:53.761949+00:00', is_active: true, notes: '',
suspended: true, banned: false, created_at: ! '2017-08-31 00:37:53.764037+00:00',
modified_at: ! '2017-08-31 00:38:00.861245+00:00', involvement: '0ebb0b5468,84309225e7'}
- model: registration.member
pk: 3
fields: {user: null, email: lovelace.a@example.com, email_consent: true, first_name: Ada,
last_name: Lovelace, preferred_name: null, date_of_birth: null, guardian_name: null,
phone: null, street: null, city: null, province: null, country: null, post_code: H0H
0H0, waiver: ! '2017-08-31 00:39:41.424933+00:00', is_active: true, notes: These
are some notes about Ada., suspended: false, banned: false, created_at: ! '2017-08-31
00:39:41.426567+00:00', modified_at: ! '2017-08-31 00:40:47.824326+00:00', involvement: 21cd9799b6}
- model: core.membership
pk: 1
fields: {created_at: ! '2017-08-31 00:36:36.851327+00:00', modified_at: ! '2017-08-31
00:36:36.866814+00:00', renewed_at: ! '2017-08-31 00:36:16.031457+00:00', self_identification: null,
gender: female, involvement: null, member: 1, payment: 1}
- model: core.membership
pk: 2
fields: {created_at: ! '2017-08-31 00:40:09.245288+00:00', modified_at: ! '2017-08-31
00:40:09.280653+00:00', renewed_at: ! '2017-08-31 00:39:54.860759+00:00', self_identification: caucasian,
gender: female, involvement: null, member: 3, payment: 2}
- model: core.payment
pk: 1
fields: {type: CHEQUE, created_at: ! '2017-08-31 00:36:36.820523+00:00'}
- model: core.payment
pk: 2
fields: {type: YOUTH, created_at: ! '2017-08-31 00:40:09.148418+00:00'}

7659
bikeshop_project/package-lock.json

File diff suppressed because it is too large

4
bikeshop_project/webpack.dev.config.js

@ -8,7 +8,7 @@ const config = require('./webpack.base.config.js');
// Use webpack dev server
config.entry = {
webpack: [
'webpack-dev-server/client?http://localhost:3000',
'webpack-dev-server/client?http://192.168.99.100:3000',
'webpack/hot/only-dev-server',
],
signin: './assets/js/index',
@ -17,7 +17,7 @@ config.entry = {
};
// override django's STATIC_URL for webpack bundles
config.output.publicPath = 'http://localhost:3000/assets/bundles/';
config.output.publicPath = 'http://192.168.99.100:3000/assets/bundles/';
config.devtool = 'eval-source-map';

Loading…
Cancel
Save