~ubuntuone-pqm-team/canonical-identity-provider/trunk

1335.1.1 by Simon Davy
use pythonpath rather than symlink for development config
1
SHELL_ENV = DJANGO_SETTINGS_MODULE=$(DJANGO_SETTINGS_MODULE) PYTHONPATH=$(PYTHONPATH)
1592.1.1 by Colin Watson
Use Python 3-style print functions.
2
PGNAME = $(shell $(SHELL_ENV) $(PYTHON) -c "from django.conf import settings; print(settings.DATABASES['default']['NAME'])")
3
PGHOST = $(shell $(SHELL_ENV) $(PYTHON) -c "from django.conf import settings; print(settings.DATABASES['default']['HOST'])")
4
PGUSER = $(shell $(SHELL_ENV) $(PYTHON) -c "from django.conf import settings; print(settings.DATABASES['default']['USER'])")
1245.2.3 by Natalia
Lots of fabric cleanups.
5
DATA_DIR = $(PGHOST)/data
6
LOG_FILE = $(PGHOST)/postgresql.log
1631.1.1 by Daniel Manrique
Fix location of custom Postgres config file.
7
CONF_FILE = $(DATA_DIR)/postgresql.conf
1668.3.1 by Guillermo Gonzalez
initial xenial porting
8
PGBIN = /usr/lib/postgresql/9.5/bin
1245.2.3 by Natalia
Lots of fabric cleanups.
9
PGCTL = $(PGBIN)/pg_ctl
10
PGINIT = $(PGBIN)/initdb
11
12
1262.2.1 by Natalia
Preparation for django 1.7
13
migrate:
1320.1.1 by Natalia
Moved bits of oauth_backend still used from SSO to the source tree to ease
14
	$(DJANGO_MANAGE) migrate --noinput
1245.2.6 by Natalia
Merged trunk in. Added syncdb, resetdb and runserver rules.
15
1262.3.1 by Natalia B. Bidart
Initial attempt for Django 1.8 migration.
16
setup-db:
1245.2.3 by Natalia
Lots of fabric cleanups.
17
	mkdir -p $(DATA_DIR)
18
	$(PGINIT) -A trust -D $(DATA_DIR)
1631.1.2 by Daniel Manrique
Append rather than clobber postgres config
19
	echo "fsync = off" >> $(CONF_FILE)
1245.2.3 by Natalia
Lots of fabric cleanups.
20
	echo "standard_conforming_strings = off" >> $(CONF_FILE)
21
	echo "escape_string_warning = off" >> $(CONF_FILE)
1251.1.4 by Matt Goodall
Use parentheses for consistency.
22
	$(PGCTL) start -w -D $(DATA_DIR) -l $(LOG_FILE) -o "-F -k $(PGHOST) -h ''"
1257.5.3 by simon.davy at canonical
make PGHOST non-global, so doesn't error when no env is present yet
23
	PGHOST=$(PGHOST) createdb $(PGNAME)
24
	PGHOST=$(PGHOST) createuser --superuser --createdb $(PGUSER)
1262.3.1 by Natalia B. Bidart
Initial attempt for Django 1.8 migration.
25
26
start-db:
27
	$(MAKE) setup-db
1262.2.5 by Natalia B. Bidart
Add comment for new try-except block on generate_openid_identifier.
28
	$(MAKE) migrate
1245.2.3 by Natalia
Lots of fabric cleanups.
29
1250.1.1 by Natalia
Improving make targets.
30
stop-db:
1257.5.3 by simon.davy at canonical
make PGHOST non-global, so doesn't error when no env is present yet
31
	PGHOST=$(PGHOST) dropdb $(PGNAME)
1245.2.3 by Natalia
Lots of fabric cleanups.
32
	$(PGCTL) stop -w -D $(DATA_DIR) -m smart
33
	rm -rf $(PGHOST)
1245.2.6 by Natalia
Merged trunk in. Added syncdb, resetdb and runserver rules.
34
1250.1.1 by Natalia
Improving make targets.
35
reset-db:
1257.5.3 by simon.davy at canonical
make PGHOST non-global, so doesn't error when no env is present yet
36
	PGHOST=$(PGHOST) dropdb $(PGNAME)
37
	PGHOST=$(PGHOST) createdb $(PGNAME)
1262.2.1 by Natalia
Preparation for django 1.7
38
	$(MAKE) migrate