-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (46 loc) · 1.56 KB
/
Makefile
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
SHELL := /bin/bash
# Git version
tag ?= stock
# Version that will be indicated in the generate docker Image
version ?= 2.15.2
# Local PostgreSQL configuration
user_pg ?= geonatadmin
password_pg ?= geonatadmin
pg_port ?= 5432
pg_database ?= geonature2db
# Module
monitoring_version ?= 1.0.1
export_version ?= 1.7.2
dashboard_version ?= 1.5.0
dump_filename = geonature_2.15.0.bi
pull_modules:
if [ ! -d gn_module_monitoring ]; then git clone https://github.com/PnX-SI/gn_module_monitoring.git; fi
if [ ! -d gn_module_export ]; then git clone https://github.com/PnX-SI/gn_module_export.git; fi
if [ ! -d gn_module_dashboard ]; then git clone https://github.com/PnX-SI/gn_module_dashboard.git; fi
cd gn_module_monitoring && git fetch origin && git checkout ${monitoring_version}
cd gn_module_export && git fetch origin && git checkout ${export_version}
cd gn_module_dashboard && git fetch origin && git checkout ${dashboard_version}
build: pull_modules
docker build \
--build-arg pg_user=${user_pg} \
--build-arg pg_password=${password_pg} \
--build-arg pg_database=geonature2db \
--build-arg GEONATURE_VERSION=${version} \
-t geonature-db-${tag}:${version} .
build_from_dump:
docker build \
-f Dockerfile.fromdump \
--build-arg dump_filename=${dump_filename} \
-t geonature-db-dump:$(basename ${dump_filename}) .
run:
docker run -d \
--name geonature-db-${tag} \
--rm \
-p ${pg_port}:5432 \
geonature-db-${tag}:${version}
run_from_dump:
docker run -d \
--name geonature-db-dump \
--rm \
-p ${pg_port}:5432 \
geonature-db-dump:$(basename ${dump_filename})