Older Bundler and Jobs
Closed this issue · 3 comments
In #150, we added the ability to support Bundler's new -j
tag. However, some people may not have Bundler 1.5 installed (ie Ubuntu 12.04 with Ruby 1.9.3). This will cause the module to error since our bundle command will exit with Unknown switches -j#
.
There are a few ways we can do this:
a) Place the -j option into the gitlab_bundler_flags
param. $gitlab_bundler_jobs
still exists and that value is used to create the bundle command, but uses having issues can override the flags to exclude -j. This doesn't change current usage, but means that the shipped version of the module is broken on systems with an older version of bundler.
b) Allow $gitlab_bundler_jobs
to be set to false. When it is false, the -j portion of the bundle command is omitted.
c) When $gitlab_bundler_jobs
is set to 1, omit the -j portion of the bundle command.
Options b and c both increase the complexity since there would be an additional branching to test for.
Any thoughts?
Oh! You're right, damn…
IMHO the solution c/ is more simpler no? (because a/ isn't very optimum (adding a param for a tool cmd), and b/ we must to change the regexp (int+undef/boolean)).
So, 👍 for c/ :)
@sbadia Should the default value be changed to 1 to be sure we do not default to a broken state on some machines?
hi @atomaka, sorry for the delay,
yes it would be nice =)
something like that no?
# Default values
$gitlab_bundler_jobs = '1'
# Real param
$gitlab_bundler_jobs_real = ($gitlab_bundler_jobs == '1') ? "" : "-j #{$gitlab_bundler_jobs}"
# Exec
command => "bundle install ${gitlab_bundler_jobs_real} --without development aws test ${gitlab_without_gems} ${gitlab_bundler_flags}",