Remove config files from repo, provide ./configure script to generate
Closes #34
This commit is contained in:
parent
352c209380
commit
5ae864a3c8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
config/environments/*.js
|
||||||
.idea
|
.idea
|
5
Makefile
5
Makefile
@ -4,5 +4,8 @@ all:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf node_modules/*
|
rm -rf node_modules/*
|
||||||
|
|
||||||
check:
|
config/environments/test.js: config/environments/test.js.example
|
||||||
|
./configure
|
||||||
|
|
||||||
|
check: config/environments/test.js
|
||||||
./run_tests.sh
|
./run_tests.sh
|
||||||
|
13
README.md
13
README.md
@ -31,19 +31,22 @@ modules. At any time just wipe out the node_modules/ directory and run
|
|||||||
Configure
|
Configure
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Edit config/environments/<env>.js files
|
Create a config/environments/<env>.js file (there are .example files
|
||||||
|
to start from).
|
||||||
|
|
||||||
Look at lib/cartodb/server_options for more on config
|
Look at lib/cartodb/server_options.js for more on config
|
||||||
|
|
||||||
Run
|
Run
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
node app.js [development | staging | production]
|
node app.js <env>
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that caches are kept in redis. If you're not seeing what
|
Where <env> is the name of a configuration file under config/environments/.
|
||||||
you expect there may be out-of-sync records in there.
|
|
||||||
|
Note that caches are kept in redis. If you're not seeing what you expect
|
||||||
|
there may be out-of-sync records in there.
|
||||||
Take a look: http://redis.io/commands
|
Take a look: http://redis.io/commands
|
||||||
|
|
||||||
|
|
||||||
|
38
configure
vendored
Executable file
38
configure
vendored
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [OPTION]"
|
||||||
|
echo
|
||||||
|
echo "Configuration:"
|
||||||
|
echo " --help display this help and exit"
|
||||||
|
echo " --with-pgport=NUM access PostgreSQL server on TCP port NUM"
|
||||||
|
}
|
||||||
|
|
||||||
|
PGPORT=5432
|
||||||
|
|
||||||
|
while test -n "$1"; do
|
||||||
|
case "$1" in
|
||||||
|
--help|-h)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--with-pgport=*)
|
||||||
|
PGPORT=`echo "$1" | cut -d= -f2`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option '$1'" >&2
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "PGPORT: $PGPORT"
|
||||||
|
|
||||||
|
# TODO: allow specifying configuration settings !
|
||||||
|
for f in config/environments/*.example; do
|
||||||
|
o=`dirname "$f"`/`basename "$f" .example`
|
||||||
|
echo "Writing $o"
|
||||||
|
# See http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/
|
||||||
|
sed -n "1h;1!H;\${;g;s/\(,postgres: {[^}]*port: *'\?\)[^',]*\('\?,\)/\1$PGPORT\2/;p;}" < "$f" > "$o"
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user