Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
update for test
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
  • Loading branch information
miurahr committed Nov 4, 2013
1 parent 87ef2c9 commit 9f0bd79
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
29 changes: 25 additions & 4 deletions Makefile
Expand Up @@ -18,11 +18,11 @@ DESTDIR ?= ${PREFIX}/bin/
HTMLDIR ?= ${PREFIX}/html/
CACHEDIR ?= ${PREFIX}/cache/
STATICDIR?= ${PREFIX}/tiles/
CONFDIR ?= /etc/
CONFDIR ?= ${PREFIX}/etc/
NGINX ?= ${CONFDIR}/nginx
OSMOSIS_WORK?= /var/opt/osmosis
WORKDIR ?= ${PREFIX}/osmosis

.PHONY: install
.PHONY: install test test_install test_service_start test_db_load

install: directories nginx_$(DISTRO) utils osmosis statictiles

Expand Down Expand Up @@ -59,4 +59,25 @@ utils:
install -c etc/*.conf $(CONFDIR)

osmosis:
cp osmosis/fabrik.txt $(OSMOSIS_WORK)/configuration.txt
cp osmosis/fabrik.txt $(WORKDIR)/configuration.txt

test: test_$(DISTRO)

test_debian:

test_redhat:

test_install: test_install_$(DISTRO)

test_install_debian:
sudo test/test_install.sh

test_install_redhat:

test_service_start:
sudo service tirex-backend-manager start
sudo service tirex-master start
sudo service nginx start

test_dbload:
sudo test/load.sh
17 changes: 2 additions & 15 deletions test/load.sh
Expand Up @@ -10,22 +10,9 @@ su postgres -c /usr/bin/tileman-create
echo COUNTRY=taiwan >> /etc/tileman.conf
echo MEMSIZE=1024 >> /etc/tileman.conf
echo PROCESS_NUM=1 >> /etc/tileman.conf
echo WORKDIR_OSM=/var/lib/osmosis >> /etc/tileman.conf
echo OSMOSIS_BIN=/usr/bin/osmosis >> /etc/tileman.conf

cp -p ${ROOTDIR}/test/taiwan-latest.osm.pbf /tmp
cp -p ${ROOTDIR}/test/state.txt /tmp
(cd /tmp;su osm -c /usr/bin/tileman-load)

# test setup
#
mkdir -p /var/www
cp ${ROOTDIR}/test/example.html /var/www/index.html
cp ${ROOTDIR}/test/tirex_mapnik_custom.conf /etc/tirex/renderer/mapnik/custom.conf
cp ${ROOTDIR}/nginx/sites/tileman-server /etc/nginx/sites-enabled/default
echo '127.0.2.1 tileserver' >> /etc/hosts
/usr/bin/python ${ROOTDIR}/bin/mapnik_stylesheets_generate_xml.py /etc/mapnik-osm-data/osm.xml /etc/mapnik-osm-data/custom.xml --password '' --dbname gis --host 'localhost' --user osm --port 5432

# start servers
service tirex-backend-manager start
service tirex-master
service nginx start

20 changes: 20 additions & 0 deletions test/test_install.sh
@@ -0,0 +1,20 @@
#!/bin/sh

PREFIX ?= /opt/tileman
DESTDIR ?= ${PREFIX}/bin/
HTMLDIR ?= ${PREFIX}/html/
CACHEDIR ?= ${PREFIX}/cache/
STATICDIR?= ${PREFIX}/tiles/
CONFDIR ?= ${PREFIX}/etc/
NGINX ?= ${CONFDIR}/nginx
WORKDIR ?= ${PREFIX}/osmosis
HTMLDIR ?= ${PREFIX}/www
SRCROOT ?= `pwd`

cp ${SRCROOT}/osmosis/fabrik.txt $(WORKDIR)/configuration.txt
mkdir -p ${HTMLDIR}
cp ${SRCROOT}/test/example.html ${HTMLDIR}/index.html
cp ${SRCROOT}/test/tirex_mapnik_custom.conf ${CONFDIR}/tirex/renderer/mapnik/custom.conf
cp ${SRCROOT}/test/tileman-test ${CONFDIR}/nginx/sites-enabled/tileman-test
/usr/bin/python ${SRCROOT}/test/mapnik_stylesheets_generate_xml.py /etc/mapnik-osm-data/osm.xml /etc/mapnik-osm-data/custom.xml --password '' --dbname gis --host 'localhost' --user osm --port 5432

0 comments on commit 9f0bd79

Please sign in to comment.