不能让Jenkins和fastlane一起工作

时间:2017-12-13 16:56:50

标签: ios jenkins continuous-integration rvm

我有一个Jenkins服务器来拉取我的构建并构建它,在shell脚本中我有一个通过分发运行的fastlane命令。问题是它永远无法成功执行。

我的shell代码很简单:

 $ bash -c export
    $ bash -c "test -f ~/.rvm/scripts/rvm"
    $ bash -c "test -f ~/.rvm/scripts/rvm"
    [App] $ bash -c " source ~/.rvm/scripts/rvm && rvm use --install --create 2.4.1 && export > rvm.env"
    Using /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1
    [App] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/jenkins2674080270342174416.sh
    + bundle exec fastlane distribute_to_testflight
    /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find CFPropertyList-2.3.6 in any of the sources (Bundler::GemNotFound)
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `map!'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `materialize'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:170:in `specs'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:237:in `specs_for'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/definition.rb:226:in `requested_specs'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/runtime.rb:108:in `block in definition_method'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/runtime.rb:20:in `setup'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler.rb:107:in `setup'
        from /Users/Shared/Jenkins/.rvm/gems/ruby-2.4.1/gems/bundler-1.16.0/lib/bundler/setup.rb:20:in `<top (required)>'
        from /Users/Shared/Jenkins/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/Shared/Jenkins/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    Build step 'Execute shell' marked build as failure
    Finished: FAILURE

调用我在我的项目中使用插件用于fastlane。

结果:

[[1,2,3,4],[0,2,3,4],[0,1,3,4],[0,1,2,4],[0,1,2,3]]

我不确定这个问题,我在jenkins用户上用rvm安装了ruby,你可以看到,但是在我的主项目中我处理代码,我只是在我的实际项目回购中有我的ruby gems和文件我承诺git,所以也许我可以让jenkins使用它从回购中提取的东西?

我真的迷失了,所以关于这个问题的任何指导都会很棒

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题并通过在捆绑执行之前调用捆绑安装来解决此问题:

bundle install 
bundle exec fastlane distribute_to_testflight

然后我在我的车道顶部使用以下 Fastlane 命令,因此从那时起它应该保持最新:

bundle_install()

答案 1 :(得分:0)

CFPropertyList-2.3.6是主要ruby gem repo中可用的宝石:https://rubygems.org

在Gemfile中添加或设置:

source "https://rubygems.org"

然后运行

bundle install

并确保您的机器可以上网。