Bountysource
如果您想使 Bountysource.com 更好,那么您来对地方了。
Bountysource 需要你的帮助!
Bountysource 是由志愿者运营的,所以开发活动可能是零星的(说得好听点)。
“我能帮忙吗?”
...用钱
...用代码
- 从我们的维基(Wiki)如何贡献开始吧
- 有许多能够帮助核心团队的高优先级问题。
- 寻找一些更简单的任务来开始?
开发者资源
本地开发环境(OS X)
# dependencies brew install rbenv brew install mysql brew install postgresql # checkout latest code git clone git@github.com:bountysource/core.git bountysource-core cd bountysource-core # make sure you're running ruby 2.4.3 (if not, mess with rbenv) ruby -v # install Gemfile gem install bundler bundle install # setup ENV cp .env.dev .env rake db:setup # start server ./bin/rails s open http://localhost:3000/
本地开发的主机名
我们需要不同的主机名,因此默认情况下我们使用以下主机名:
- http://localhost:3000/ - bountysource
- http://127.0.0.1:3000/ - salt
- http://0.0.0.0:3000/ - api
或者,您可以将条目添加到 /etc/hosts 并更改 .env 文件中的主机名:
127.0.0.1 www.bountysource.local api.bountysource.local salt.bountysource.local
运行测试
RAILS_ENV=test rake db:create ./bin/rake
使用 Docker 的本地开发环境(不建议使用)
对于自托管,您需要 Docker 和 Docker Compose。
以下是在 Ubuntu 16.04 LTS 上测试的结果。它在其他 Linux 发行版上可能非常相似。
第一个技巧,不要担心发行版提供的 Docker 或 Docker Compose 软件包(太旧,已被取代)。
只需从 upstream 安装。要安装 Docker,请执行
curl -sSL https://get.docker.com | sh
运行没有超级用户权限的 Docker(sudo):
sudo usermod -aG docker $USER
然后安装 Python virtualenv:
sudo apt-get install python-virtualenv
创建一个新的 virtualenv 并将 Docker Compose 安装到该目录中:
virtualenv ~/docker-compose source ~/docker-compose/bin/activate pip install docker-compose
以下是我得到的版本:
(cpy361_6) oberstet@thinkpad-t430s:~/scm/oberstet/bountysource_core$ docker --version Docker version 17.05.0-ce, build 89658be (cpy361_6) oberstet@thinkpad-t430s:~/scm/oberstet/bountysource_core$ docker-compose --version docker-compose version 1.13.0, build 1719ceb
现在拉出并构建所有必需的 Docker 映像:
docker-compose -f docker-compose.yml build
然后启动与该服务相关的 Docker 容器:
docker-compose -f docker-compose.yml up -d
这应该启动3个 Docker 容器(Bountysource、PostgreSQL 和 Sphinx):
(cpy361_6) oberstet@thinkpad-t430s:~/scm/oberstet/bountysource_core$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 04599623589b bountysourcecore_bountysource "rails s" 11 minutes ago Up 11 minutes 0.0.0.0:3000->3000/tcp bountysource 27157a0c1ec0 leodido/sphinxsearch:2.2.9 "searchd.sh" 11 minutes ago Up 11 minutes 9306/tcp, 9312/tcp sphinx 45c0202dd08b postgres "docker-entrypoint..." 11 minutes ago Up 11 minutes 5432/tcp pgsql
然后在浏览器中打开 http://localhost:3000。
您应该看到 Bountysource 的开始页面,如这里。
运行单元测试
运行单元测试:
docker-compose -f docker-compose.yml -f tasks.yml up test
您最终应该会看到类似以下内容:
(cpy361_6) oberstet@thinkpad-t430s:~/scm/3rdparty/bountysource_core$ docker-compose -f docker-compose.yml -f tasks.yml up test Starting pgsql ... Starting pgsql ... done Starting sphinx ... Starting sphinx ... done Starting bountysourcecore_test_1 ... Starting bountysourcecore_test_1 ... done Attaching to bountysourcecore_test_1 test_1 | .. lots of output (snipped) .. test_1 | Finished in 2 minutes 48.5 seconds (files took 7.23 seconds to load) test_1 | 1239 examples, 0 failures, 13 pending test_1 | bountysourcecore_test_1 exited with code 0