Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 92 lines (82 sloc) 2.034 kb
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
1 #!/bin/bash
2
4bb8f3d @kocolosk Apache 2 license, Cloudant copyright when appropriate
kocolosk authored
3 # Copyright 2010 Cloudant
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 # use this file except in compliance with the License. You may obtain a copy of
7 # the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 # License for the specific language governing permissions and limitations under
15 # the License.
16
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
17 function quit {
18 exit
19 }
20
3b92c5d @kocolosk make the default install prefix /opt/dbcore
kocolosk authored
21 PREFIX="/opt/dbcore"
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
22 DBCORE_USER=`whoami`
f0d0516 @kocolosk 'make dev' generates rel/dev[123]
kocolosk authored
23 ABSPATH="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
24 DIRPATH=`dirname "$ABSPATH"`
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
25
26 while [ $# -gt 0 ]
27 do
28 case $1
29 in
30 -p)
31 PREFIX=$2
32 shift 2
33 ;;
34 -t)
35 TEMPLATE=$2
36 shift 2
37 ;;
38 -d)
39 DATA=$2
40 shift 2
41 ;;
42 -v)
43 VIEW=$2
44 shift 2
45 ;;
46 -u)
47 DBCORE_USER=$2
48 shift 2
49 ;;
50 *)
51 echo "usage: $0 [-p {prefix} -t {template} -d {data_dir} -v {view_dir} -u {user}]"
52 quit
53 ;;
54 esac
55 done
56
f16942a @kocolosk default data storage is /var/lib
kocolosk authored
57 if test ! -n "$DATA"; then DATA="$PREFIX/var/lib"; fi
58 if test ! -n "$VIEW"; then VIEW="$PREFIX/var/lib"; fi
59
1dc641b @kocolosk s/overlay.config/dbcore.config
kocolosk authored
60 echo "==> configuring dbcore in rel/dbcore.config"
61 cat > rel/dbcore.config << EOF
264cb29 @kocolosk no more rebar templates in configure
kocolosk authored
62 {prefix, "$PREFIX"}.
63 {data_dir, "$DATA"}.
64 {view_dir, "$VIEW"}.
65 {user, "$DBCORE_USER"}.
8d210c5 @kocolosk configure ports and node names, also correct a few bugs
kocolosk authored
66 {node_name, "-name dbcore"}.
67 {cluster_port, 5984}.
68 {backend_port, 5986}.
264cb29 @kocolosk no more rebar templates in configure
kocolosk authored
69 EOF
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
70
264cb29 @kocolosk no more rebar templates in configure
kocolosk authored
71 cat > install.mk << EOF
72 # The contents of this file are auto-generated by configure
73 prefix = $PREFIX
74 data_dir = $DATA
75 view_dir = $VIEW
76 user = $DBCORE_USER
77 EOF
bb9e2ce @bradnoble lay down cloudant build system.
bradnoble authored
78
f0d0516 @kocolosk 'make dev' generates rel/dev[123]
kocolosk authored
79 # finally, a few config files for local development nodes
80 for i in 1 2 3; do
81 cat > rel/dev$i.config << EOF
82 {prefix, "$DIRPATH/rel/dev$i"}.
83 {data_dir, "$DIRPATH/rel/tmpdata/dev$i"}.
8d210c5 @kocolosk configure ports and node names, also correct a few bugs
kocolosk authored
84 {view_dir, "$DIRPATH/rel/tmpdata/dev$i"}.
85 {node_name, "-name dev$i@127.0.0.1"}.
86 {cluster_port, `expr 10000 \* $i + 5984`}.
87 {backend_port, `expr 10000 \* $i + 5986`}.
f0d0516 @kocolosk 'make dev' generates rel/dev[123]
kocolosk authored
88 EOF
89 done
90
1897776 @kocolosk one last mention of overlay.config
kocolosk authored
91 cat rel/dbcore.config
Something went wrong with that request. Please try again.