-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_test.sh
70 lines (36 loc) · 1.29 KB
/
install_test.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
## This script is not a production installation script. It works on author's
# Centos virtual machine and is here for documentation purposes. There is
# no guarantee it won't fuck up your system if you run it, so don't.
# Work in home directory
cd
## Install git and get the source code.
sudo yum -y install git
git clone https://github.com/juhovuori/catconf.git
## First we need to enable EPEL-repository.
curl http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm -O
curl http://rpms.famillecollet.com/enterprise/remi-release-6.rpm -O
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
## Install couchdb
sudo yum -y install couchdb
sudo service couchdb start
sudo chkconfig --level 2 couchdb on
## Cp and edit conf.js
cd catconf
cp conf.js.dist conf.js
# We are lucky, the default configuration is ok for testing - no need to edit
## Install node.js and npm
sudo yum -y install nodejs npm make
## Install dependencies
npm install
npm update
## Create couchdb admin user
curl -X PUT http://localhost:5984/_config/admins/admin -d '"admin"'
## Setup database
node manage.js install
## Open a port from firewall
sudo iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 3000 -j ACCEPT
## Run tests
make test
# Run server
# node catconf.js