如何配置Shippable从单个存储库构建所有项目?

时间:2015-11-21 23:05:47

标签: git configuration server repository bitbucket

我有一个带有3个项目的bitbucket存储库。

myRepo   APP1(红宝石上轨)   APP2(node.js中)   APP3(node.js中)

现在我正在尝试使用此存储库配置Shippable(https://app.shippable.com/)来构建所有这3个项目并对它们运行所有测试。

我知道我应该在我的存储库的根目录中配置shippable.yml文件,到目前为止,我已经达到了某些运气点,我在这里可以看到...

language: ruby

rvm:
  - 2.2.2

env:
  - CI_REPORTS=shippable/testresults COVERAGE_REPORTS=shippable/codecoverage

before_script:
  - cd app1 && mkdir -p shippable/testresults
  - bundle install
  - mvn build

script:
  - rake db:setup
  - cd ../app2 && mvn build
  - cd ../app3 && mvn build

我的问题是如何正确地做到这一点?

到目前为止,我试图做这样的事情,但没有运气。

现在使用此脚本我收到此错误。

mvn build
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.146 s
[INFO] Finished at: 2015-11-21T22:32:28+00:00
[INFO] Final Memory: 14M/965M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/shippable/workspace/src/bitbucket.org/etibartartu/approot/app1). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

我想知道是否有任何人可以有任何建议如何编写.yml文件以使其工作。

Shippable中正常的建筑应用流程是这样的。

Clone/Pull the project from Github. This depends on whether the minion is in pristine state or not
cd into the workspace
Checkout the commit that is getting built
Run the before_install section. This is typically used to prep your minion and update any packages
Run install section to install any project specific libraries or packages
Run before_script section to create any folders and unzip files that might be needed for testing. Some users also restore DBs etc. here
Run the script command which runs build and all your tests
Run either after_success or after_failure commands
Run after_script commands

1 个答案:

答案 0 :(得分:0)

我不知道将来是否会有人需要它。但我找到了解决方案......

  - cd app1 && mkdir -p shippable/testresults
  - bundle install
  - rake db:setup
  - rails s -p 8081 -b 0.0.0.0 &

我基本上忘了将&符号放在正在运行的服务器的末尾,所以它不是在后台运行而且VM卡住了。