Jenkins using System Ruby - use rvm ruby?

2019-08-30 10:15发布

Jenkins is kindly running an Ant build for us. The Ant build orchestrates CI for an Objective-C project - a library that is available on both iOS and OSX.

This Ant build can be run both in or out of Jenkins, so devs can verify their work before checking in, and Jenkins will provide another layer of checks. (Therefore reducing the chance of a broken build impacting other contributors).

I've created a task that does the following:

<target name="--podspec.lint">
    <exec executable="pod" failifexecutionfails="yes" failonerror="yes">
        <arg line="spec lint ProjectName.podspec"/>
    </exec>
</target>

. . it seems that Jenkins is using the System Ruby, even though the machine has RVM installed. Is there a way to tell Jenkins to use the rvm version? This seems like a path problem - the sytem bin dirs have moved the the front of the path, even though RVM takes precedence in the .profile.

1条回答
Fickle 薄情
2楼-- · 2019-08-30 10:35

This tutorial should have everything you need. It is written for Ubuntu, but you should be able to do something analogous for your OS if it differs.

The main thrust is that you need to configure a jenkins user and then setup rvm for that jenkins user.

查看更多
登录 后发表回答