From 961269fa1f1cf1478a831866373133ef6f75a52d Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 24 Sep 2012 17:57:39 +0200 Subject: [PATCH] Autodetect target mapnik version and let config override it Closes #40 --- config/environments/development.js.example | 1 + config/environments/production.js.example | 1 + config/environments/staging.js.example | 1 + config/environments/test.js.example | 1 + lib/cartodb/server_options.js | 7 +++++-- npm-shrinkwrap.json | 11 ++++++----- package.json | 3 ++- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 8e6c1f77..d44a2eca 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -19,6 +19,7 @@ var config = { */ simplify: true } + ,mapnik_version: '2.0.2' ,millstone: { cache_basedir: '/tmp/cdb-tiler-dev/millstone-dev' } diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 1198afd5..da3e8c25 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -13,6 +13,7 @@ var config = { extent: "-20005048.4188,-20005048.4188,20005048.4188,20005048.4188", simplify: true } + ,mapnik_version: '2.0.2' ,millstone: { cache_basedir: '/home/ubuntu/tile_assets/' } diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 707b2a70..e2522451 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -13,6 +13,7 @@ var config = { extent: "-20005048.4188,-20005048.4188,20005048.4188,20005048.4188", simplify: true } + ,mapnik_version: '2.0.2' ,millstone: { cache_basedir: '/home/ubuntu/tile_assets/' } diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 2d6d4891..a021f25b 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -14,6 +14,7 @@ var config = { extent: "-20005048.4188,-20005048.4188,20005048.4188,20005048.4188", simplify: true } + ,mapnik_version: '2.0.2' ,millstone: { cache_basedir: '/tmp/cdb-tiler-test/millstone' } diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 5bdecdf5..2a2a11aa 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -1,14 +1,17 @@ var _ = require('underscore') , Step = require('step') , cartoData = require('./carto_data') - , Cache = require('./cache_validator'); + , Cache = require('./cache_validator') + , mapnik = require('mapnik') + ; module.exports = function(){ var me = { base_url: '/tiles/:table', grainstore: { datasource: global.environment.postgres, - cachedir: global.environment.millstone.cache_basedir + cachedir: global.environment.millstone.cache_basedir, + mapnik_version: global.environment.mapnik_version || mapnik.versions.mapnik }, redis: global.environment.redis, enable_cors: global.environment.enable_cors, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 975a914f..b36c59cb 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,9 +1,10 @@ { "name": "windshaft-cartodb", - "version": "0.2.0-dev", + "version": "1.0.0", "dependencies": { "cluster2": { - "version": "0.3.5", + "version": "0.3.5-cdb01", + "from": "git://github.com/CartoDB/cluster2.git#28cde11", "dependencies": { "express": { "version": "2.5.11", @@ -299,9 +300,6 @@ "version": "0.3.3-dev", "from": "git://github.com/Vizzuality/tilelive-mapnik.git#7df70554", "dependencies": { - "mapnik": { - "version": "0.7.14" - }, "eio": { "version": "0.1.0" }, @@ -327,6 +325,9 @@ "request": { "version": "2.9.202" }, + "mapnik": { + "version": "0.7.14" + }, "mocha": { "version": "1.2.1", "dependencies": { diff --git a/package.json b/package.json index c014b39c..698b94b3 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "generic-pool": "1.0.x", "redis": "0.7.2", "hiredis": "~0.1.14", - "request": "2.9.202" + "request": "2.9.202", + "mapnik": "~0.7.14" }, "devDependencies": { "mocha": "1.2.1"