-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (66 loc) · 2.2 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Prepares a container environment in order to
# save a Docker image that provides a SIOSE
# database instance with pg_runoff extension.
# REQUIREMENTS:
# 1. An ext-creator image must be properly
# compiled and registered with a name
# that matches the image name for ext-creator
# service in docker-compose.yml.template.
# To compile an ext-creator image use
# lib/ext-creator/[VERSION]/Dockerfile
# in this repository.
# 2. A SIOSE Docker image must be properly
# compiled and its registered name assigned
# to Makefile variable BASE. An instance of
# this image must provide a SIOSE database
# which is compliant with the MF2 data model.
COMPOSE = docker-compose.yml
TEMPLATE = $(COMPOSE).template
VERSION = 0.1
# Assign values as needed to vars below.
# Then run:
# $ make clean
# $ make
# $ sudo make install
# $ docker-compose up
# To save the final image, run the following
# on a separate shell:
# $ docker commit pg_runoff_host [NEW_IMAGE_NAME]
# $ docker-compose down
# SUBTAG for new Docker image.
# The outcome of `sudo make install`
# will be a new Docker image named
# siose-innova/preinstalled-pg_runoff:$VERSION-$SUBTAG
# where $SUBTAG may follow a convention such as
# [SIOSE_AREA_EXTENT]_[YYYY].
# Valid values for the term [SIOSE_AREA_EXTENT]
# Geohash strings and administrative boundary codes.
SUBTAG = 1003_2014
# BASE Docker image.
# This must be a SIOSE database instance compliant
# with the MF2 data model. Database instances may
# cover the whole or part of SIOSE's extension.
BASE = siose-innova/mf2-1003:2014
# DB name.
# This is the name of the target SIOSE database
# within BASE image.
DB = siose2014
# SCHEMA name.
# This is the name of the target schema in DB.
SCHEMA = s2014
# eXtensioN SCHEMA name
# This is the name of the schema which pg_runoff
# extension objects are located in
XNSCHEMA = runoff
$(COMPOSE) : $(TEMPLATE)
sed -e "s/\$$VERSION/$(VERSION)/g" \
-e "s/\$$SUBTAG/$(SUBTAG)/g" \
-e "s/\$$BASE/$(subst /,\/,$(BASE))/g" \
-e "s/\$$DB/$(DB)/g" \
-e "s/\$$SCHEMA/$(SCHEMA)/g" \
-e "s/\$$XNSCHEMA/$(XNSCHEMA)/g" $< > $@
.PHONY: install clean
install :
docker-compose build
clean :
rm -f $(COMPOSE)