8000 Merge pull request #69 from dongweiming/started · lcppcl/code@0b3e3d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b3e3d4

Browse files
committed
Merge pull request douban#69 from dongweiming/started
Add virtualbox env
2 parents 42ad89b + d99aac3 commit 0b3e3d4

File tree

3 files changed

+20
-38
lines changed

3 files changed

+20
-38
lines changed

README.md

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ $boot2docker ip
3939
$docker run -t -i code /bin/bash
4040
```
4141

42+
Vagrant Installation
43+
--------------------
44+
45+
```
46+
$cd code
47+
vagrant up
48+
```
49+
4250
Quick Installation
4351
------------------
4452
Currently supports the following systems:
@@ -58,47 +66,11 @@ bash <(curl -s https://raw.githubusercontent.com/douban/code/master/scripts/inst
5866
Notes: The install script in `code/scripts` subdirectory, for example ubuntu/debian,
5967
You can see `code/scripts/ubuntu.sh`
6068

61-
Prepare
62-
-------
63-
- mysql # default port
64-
65-
```
66-
# import vilya/databases/schema.sql to database `valentine`
67-
$ mysql -uroot -e 'create database valentine;'
68-
$ mysql -uroot -D valentine < vilya/databases/schema.sql
69-
```
70-
71-
- memcached # default port
72-
73-
- customize code config
74-
```
75-
# after clone code repo you can change the default config by:
76-
$ cd {CODE_REPO}
77-
$ cp vilya/local_config.py.tmpl vilya/local_config.py
78-
# overwrite configs defined in vilya/config.py.
79-
$ vim vilya/local_config.py
80-
```
81-
82-
Getting started
83-
---------------
84-
```
85-
git clone https://github.com/douban/code.git
86-
cd code
87-
mysql -uroot -e 'create database valentine;'
88-
mysql -uroot -D valentine < vilya/databases/schema.sql
89-
virtualenv venv
90-
. venv/bin/activate
91-
pip install cython # should install first
92-
pip install -U setuptools
93-
pip install -r requirements.txt
94-
gunicorn -w 2 -b 127.0.0.1:8000 app:app # web & git http daemon
95-
```
96-
9769
FAQ
9870
----
9971

10072
1. single http daemon
101-
- `gunicorn -b 127.0.0.1:8001 smart_httpd:app` # git http daemon
73+
- `gunicorn -b 127.0.0.1:8001 app:app` # git http daemon
10274

10375
2. vilya.config.DOMAIN
10476
- if you run 'gunicorn -b IP:PORT app:app', the DOMAIN should be 'http://IP:PORT/'

Vagrantfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- mode: ruby -*-
2+
3+
Vagrant.configure(2) do |config|
4+
config.vm.box = "dongweiming/code"
5+
6+
config.vm.network :forwarded_port, guest: 8200, host: 8200
7+
for i in 29000..30000
8+
config.vm.network :forwarded_port, guest: i, host: i
9+
end
10+
end

scripts/ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sudo apt-get install build-essential g++ git python-pip python-virtualenv dh-aut
88

99
echo "Install mysql..."
1010
sudo apt-get install mysql-client mysql-server libmysqlclient-dev -yq
11-
/etc/init.d/mysql restart
11+
sudo /etc/init.d/mysql restart
1212

1313
echo "Setup memcached port to 11311..."
1414
sudo sed -i "s/11211/11311/g" /etc/memcached.conf

0 commit comments

Comments
 (0)
0