-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (52 loc) · 1.78 KB
/
Makefile
File metadata and controls
69 lines (52 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## postgres Makefile.
## Used with dcape at ../../
#:
SHELL ?= /bin/bash
CFG ?= .env
# Docker image version tested for actual dcape release
DB_VER0 ?= 15.2
#- ******************************************************************************
#- Postgresql: general config
#- Postgresql docker image
DB_IMAGE ?= postgres
#- Postgresql docker image version
DB_VER ?= $(DB_VER0)
#- ------------------------------------------------------------------------------
#- Postgresql: internal config
#- Postgresql container hostname
DB_HOSTNAME ?= db
#- Postgresql Database superuser password
DB_ADMIN_PASS ?= $(shell openssl rand -hex 16; echo)
#- Postgresql Database encoding
DB_ENCODING ?= en_US.UTF-8
#- port on localhost postgresql listen on
DB_PORT_LOCAL ?= 5433
#- shared memory
DB_SHM_SIZE ?= 64mb
#- initdbargs for customise create postgres cluster
DB_INITDB_ARGS ?= --lc-message=C --auth-host=md5
#- dcape root directory
DCAPE_ROOT ?= ../../
#- prefix for shared_preload_libraries
DB_LIB_PREFIX ?=
# ------------------------------------------------------------------------------
-include $(CFG).bak
export
-include $(CFG)
export
ifdef DCAPE_STACK
include $(DCAPE_ROOT)/Makefile.dcape
else
include $(DCAPE_ROOT)/Makefile.app
endif
# ------------------------------------------------------------------------------
# check app version
init:
@if [[ "$$DB_VER0" != "$$DB_VER" ]] ; then \
echo "Warning: DB_VER in dcape ($$DB_VER0) differs from yours ($$DB_VER)" ; \
fi
# pgtop database name
DB ?= postgres
## PG top via pgcenter `make pgtop DB=postgres`
pgtop:
@docker run -it --rm --network $${DCAPE_NET} -e PGPASSWORD=$(DB_ADMIN_PASS) -e PGDATABASE=$(DB) lesovsky/pgcenter:latest pgcenter top -h $(DB_HOSTNAME) -U postgres