Support for Bundler added

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Support for Bundler added

Brian Guthrie-3
Hi all,

I've added basic support for Bundler in commit
2fe5d1b45105fd6f32a091165cdcb608403ac35b. Although I've tried to
adhere to the spirit of cross-platform compatibility, I haven't yet
had a chance to test it in Windows, so if you do so please share your
experience. Here's how it works:

 - If a project is configured with rake_command (or build_command is
omitted) and includes a Gemfile in its root, it's assumed that you
want to perform a bundle install.
 - You can explicitly disable this behavior with project.use_bundler = false.
 - If bundler support is triggered, CC.rb will perform a bundle check
followed by a bundle install if the check fails.
 - Going per Ryan McGeary's advice[1], bundle install defaults to
--path=vendor so as to avoid interfering with other gems installed on
the system. Open to feedback on this.
 - The absolute paths to each project's local vendor and Gemfiles are
passed as arguments to bundle install.

Relevant method is Build#bundle_install. Please take a look.

Cheers,

Brian

[1] "Vendor everything" still applies,
http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Support for Bundler added

Chad Woolley
On Tue, May 10, 2011 at 6:39 AM, Brian Guthrie
<[hidden email]> wrote:

> Hi all,
>
> I've added basic support for Bundler in commit
> 2fe5d1b45105fd6f32a091165cdcb608403ac35b. Although I've tried to
> adhere to the spirit of cross-platform compatibility, I haven't yet
> had a chance to test it in Windows, so if you do so please share your
> experience. Here's how it works:
>
>  - If a project is configured with rake_command (or build_command is
> omitted) and includes a Gemfile in its root, it's assumed that you
> want to perform a bundle install.
>  - You can explicitly disable this behavior with project.use_bundler = false.
>  - If bundler support is triggered, CC.rb will perform a bundle check
> followed by a bundle install if the check fails.
>  - Going per Ryan McGeary's advice[1], bundle install defaults to
> --path=vendor so as to avoid interfering with other gems installed on
> the system. Open to feedback on this.
>  - The absolute paths to each project's local vendor and Gemfiles are
> passed as arguments to bundle install.
>
> Relevant method is Build#bundle_install. Please take a look.

I'd allow the 'bundle install' command string to be
configurable/overrideable.  For example, I like to package all gems,
so I can run 'bundle install --local' and avoid the unnecessary time
to pull the index from the remote servers.  This should also allow
workarounds for any other edge cases involving special use of bundler.

-- Chad
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Support for Bundler added

Brian Guthrie-3
On Wed, May 11, 2011 at 9:15 AM, Chad Woolley <[hidden email]> wrote:

> On Tue, May 10, 2011 at 6:39 AM, Brian Guthrie
> <[hidden email]> wrote:
>> Hi all,
>>
>> I've added basic support for Bundler in commit
>> 2fe5d1b45105fd6f32a091165cdcb608403ac35b. Although I've tried to
>> adhere to the spirit of cross-platform compatibility, I haven't yet
>> had a chance to test it in Windows, so if you do so please share your
>> experience. Here's how it works:
>>
>>  - If a project is configured with rake_command (or build_command is
>> omitted) and includes a Gemfile in its root, it's assumed that you
>> want to perform a bundle install.
>>  - You can explicitly disable this behavior with project.use_bundler = false.
>>  - If bundler support is triggered, CC.rb will perform a bundle check
>> followed by a bundle install if the check fails.
>>  - Going per Ryan McGeary's advice[1], bundle install defaults to
>> --path=vendor so as to avoid interfering with other gems installed on
>> the system. Open to feedback on this.
>>  - The absolute paths to each project's local vendor and Gemfiles are
>> passed as arguments to bundle install.
>>
>> Relevant method is Build#bundle_install. Please take a look.
>
> I'd allow the 'bundle install' command string to be
> configurable/overrideable.  For example, I like to package all gems,
> so I can run 'bundle install --local' and avoid the unnecessary time
> to pull the index from the remote servers.  This should also allow
> workarounds for any other edge cases involving special use of bundler.
>
> -- Chad

Thanks for the feedback. I agree that this behavior needs to be configurable.

My one question around overriding relates to actually locating the
bundle executable. Right now I'm attempting to resolve and use a full
path, because I'm worried that gem executables may not always be part
of the PATH; if that indeed is the case, allowing the user to override
that command would mean they'd either need to take responsibility for
specifying the path themselves, or CC.rb would need to perform some
kind of substitution to ensure that the full path gets added to the
executed command. Perhaps something like:

  project.bundle_install = "%bundle% install --local"

If specifying the full path is ridiculous, I'll remove it and move on.

Brian
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Support for Bundler added

Alexey Verkhovsky-2
Similar story with path to rake executable is the reason why default build behavior invokes rake as a Ruby script, not as an executable.

On Tue, May 10, 2011 at 6:11 PM, Brian Guthrie <[hidden email]> wrote:
On Wed, May 11, 2011 at 9:15 AM, Chad Woolley <[hidden email]> wrote:
> On Tue, May 10, 2011 at 6:39 AM, Brian Guthrie
> <[hidden email]> wrote:
>> Hi all,
>>
>> I've added basic support for Bundler in commit
>> 2fe5d1b45105fd6f32a091165cdcb608403ac35b. Although I've tried to
>> adhere to the spirit of cross-platform compatibility, I haven't yet
>> had a chance to test it in Windows, so if you do so please share your
>> experience. Here's how it works:
>>
>>  - If a project is configured with rake_command (or build_command is
>> omitted) and includes a Gemfile in its root, it's assumed that you
>> want to perform a bundle install.
>>  - You can explicitly disable this behavior with project.use_bundler = false.
>>  - If bundler support is triggered, CC.rb will perform a bundle check
>> followed by a bundle install if the check fails.
>>  - Going per Ryan McGeary's advice[1], bundle install defaults to
>> --path=vendor so as to avoid interfering with other gems installed on
>> the system. Open to feedback on this.
>>  - The absolute paths to each project's local vendor and Gemfiles are
>> passed as arguments to bundle install.
>>
>> Relevant method is Build#bundle_install. Please take a look.
>
> I'd allow the 'bundle install' command string to be
> configurable/overrideable.  For example, I like to package all gems,
> so I can run 'bundle install --local' and avoid the unnecessary time
> to pull the index from the remote servers.  This should also allow
> workarounds for any other edge cases involving special use of bundler.
>
> -- Chad

Thanks for the feedback. I agree that this behavior needs to be configurable.

My one question around overriding relates to actually locating the
bundle executable. Right now I'm attempting to resolve and use a full
path, because I'm worried that gem executables may not always be part
of the PATH; if that indeed is the case, allowing the user to override
that command would mean they'd either need to take responsibility for
specifying the path themselves, or CC.rb would need to perform some
kind of substitution to ensure that the full path gets added to the
executed command. Perhaps something like:

 project.bundle_install = "%bundle% install --local"

If specifying the full path is ridiculous, I'll remove it and move on.

Brian
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers



--
Alexey Verkhovsky
http://alex-verkhovsky.blogspot.com/
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]


_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
Reply | Threaded
Open this post in threaded view
|

Re: Support for Bundler added

Brian Guthrie-3
Can you find the Rake executable by using RbConfig? Currently I'm
using the following to find the gem command:

  File.join RbConfig::CONFIG['bindir'], "gem"

and presumably you could do the same thing with Rake, but it needs to
be tested in JRuby.

Brian

On Wed, May 11, 2011 at 6:54 PM, Alexey Verkhovsky
<[hidden email]> wrote:

> Similar story with path to rake executable is the reason why default build
> behavior invokes rake as a Ruby script, not as an executable.
>
> On Tue, May 10, 2011 at 6:11 PM, Brian Guthrie <[hidden email]>
> wrote:
>>
>> On Wed, May 11, 2011 at 9:15 AM, Chad Woolley <[hidden email]>
>> wrote:
>> > On Tue, May 10, 2011 at 6:39 AM, Brian Guthrie
>> > <[hidden email]> wrote:
>> >> Hi all,
>> >>
>> >> I've added basic support for Bundler in commit
>> >> 2fe5d1b45105fd6f32a091165cdcb608403ac35b. Although I've tried to
>> >> adhere to the spirit of cross-platform compatibility, I haven't yet
>> >> had a chance to test it in Windows, so if you do so please share your
>> >> experience. Here's how it works:
>> >>
>> >>  - If a project is configured with rake_command (or build_command is
>> >> omitted) and includes a Gemfile in its root, it's assumed that you
>> >> want to perform a bundle install.
>> >>  - You can explicitly disable this behavior with project.use_bundler =
>> >> false.
>> >>  - If bundler support is triggered, CC.rb will perform a bundle check
>> >> followed by a bundle install if the check fails.
>> >>  - Going per Ryan McGeary's advice[1], bundle install defaults to
>> >> --path=vendor so as to avoid interfering with other gems installed on
>> >> the system. Open to feedback on this.
>> >>  - The absolute paths to each project's local vendor and Gemfiles are
>> >> passed as arguments to bundle install.
>> >>
>> >> Relevant method is Build#bundle_install. Please take a look.
>> >
>> > I'd allow the 'bundle install' command string to be
>> > configurable/overrideable.  For example, I like to package all gems,
>> > so I can run 'bundle install --local' and avoid the unnecessary time
>> > to pull the index from the remote servers.  This should also allow
>> > workarounds for any other edge cases involving special use of bundler.
>> >
>> > -- Chad
>>
>> Thanks for the feedback. I agree that this behavior needs to be
>> configurable.
>>
>> My one question around overriding relates to actually locating the
>> bundle executable. Right now I'm attempting to resolve and use a full
>> path, because I'm worried that gem executables may not always be part
>> of the PATH; if that indeed is the case, allowing the user to override
>> that command would mean they'd either need to take responsibility for
>> specifying the path themselves, or CC.rb would need to perform some
>> kind of substitution to ensure that the full path gets added to the
>> executed command. Perhaps something like:
>>
>>  project.bundle_install = "%bundle% install --local"
>>
>> If specifying the full path is ridiculous, I'll remove it and move on.
>>
>> Brian
>> _______________________________________________
>> Cruisecontrolrb-developers mailing list
>> [hidden email]
>> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
>
>
>
> --
> Alexey Verkhovsky
> http://alex-verkhovsky.blogspot.com/
> CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
>
>
> _______________________________________________
> Cruisecontrolrb-developers mailing list
> [hidden email]
> http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers
>
>
_______________________________________________
Cruisecontrolrb-developers mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-developers