This repository has been archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (23 loc) · 1.66 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
SITE_HOST=$(shell grep -w '^SITEURL' /etc/geonode/local_settings.py | sed 's@.*http://@@g;s@/.*@@g')
GEM_BASEDIR?=/var/lib/openquake/
GEM_TMPDIR=/tmp
BASE_INST_DIR=$(GEM_BASEDIR)oq-ui-geoserver/
BASE_SRC_DIR=
deploy: install postinst
debugvars:
@echo "SITE_HOST=[$(SITE_HOST)] GEM_BASEDIR=[$(GEM_BASEDIR)] GEM_TMPDIR=[$(GEM_TMPDIR)] BASE_INST_DIR=[$(BASE_INST_DIR)]"
install:
test -d $(BASE_INST_DIR) || mkdir -p $(BASE_INST_DIR)
rm -rf "$(BASE_INST_DIR)geoserver"
cp -a geoserver "$(BASE_INST_DIR)"
chown -R tomcat6.tomcat6 $(BASE_INST_DIR)geoserver
postinst:
./bin/geoserver-xml-mangler.py install $$(find "$(BASE_INST_DIR)geoserver/data/workspaces/" -type f -name datastore.xml | grep -v "$(BASE_INST_DIR)geoserver/data/workspaces/temp")
./bin/config_mangle.sh $(GEM_BASEDIR) $(GEM_TMPDIR) $(SITE_HOST)
template:
./bin/geoserver-xml-mangler.py template $$(find "$(BASE_SRC_DIR)geoserver/data/workspaces/" -type f -name datastore.xml | grep -v "$(BASE_SRC_DIR)geoserver/data/workspaces/temp")
populate:
curl --header "Content-Type: text/xml" -v -d @data/styles/geodetic.xml -u $(GEM_DJANGO_SUSER):$(GEM_DJANGO_SPASS) -X POST http://$(SITE_HOST):8080/geoserver/rest/styles
curl --header "Content-Type: application/vnd.ogc.sld+xml" -v -d @data/styles/geodetic.sld -u $(GEM_DJANGO_SUSER):$(GEM_DJANGO_SPASS) -X PUT http://$(SITE_HOST):8080/geoserver/rest/styles/geodetic.sld
curl -u $(GEM_DJANGO_SUSER):$(GEM_DJANGO_SPASS) -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>geodetic</name></defaultStyle><enabled>true</enabled></layer>' http://$(SITE_HOST):8080/geoserver/rest/layers/geodetic_geodetic
.PHONY: deploy install postinst template debugvars populate