Project

General

Profile

« Previous | Next » 

Revision 227

Moved db user creation to scripts/Makefile. Removed now-unneeded admin scripts.

View differences:

Makefile
1 1
export PGOPTIONS = --client-min-messages=WARNING
2 2

  
3 3
psqlOpts = --set ON_ERROR_STOP=1 --quiet
4
psqlAdmin = sudo -u postgres psql $(psqlOpts)
4
asAdmin = sudo -u postgres
5
psqlAdmin = $(asAdmin) psql $(psqlOpts)
6
dbConfig = . util/vegbien_dest.sh
5 7
psqlDbUser = ./util/psql_vegbien $(psqlOpts)
6 8

  
7 9
all: install
......
24 26
	$(psqlDbUser) <../mappings/schemas/vegbien_empty.sql
25 27

  
26 28
user: FORCE
27
	-./admin/bien_user_create
29
	@echo "At prompt \"Password:\", enter *your* password for sudo"
30
	@sudo -v
31
	@($(dbConfig); echo "At prompt \"Enter password for new role:\", \
32
	enter $$out_password")
33
	-$(user_cmd)
28 34
# ignore errors about existing user
35
user_cmd = ($(dbConfig); $(asAdmin) createuser --no-superuser --no-createdb \
36
--no-createrole --pwprompt "$$out_user")
29 37

  
30 38
rm_user: FORCE
31 39
	echo "DROP USER bien;"|$(psqlAdmin)

Also available in: Unified diff