Explicitly set --bindir when isntalling bundle

... so that we can make sure that bundle command is installed in
GEM_HOME/bin directory.

Change-Id: I1ea78bbd2b7fe22d510e10b0c96c0ed7bdc9f8a3
Closes-Bug: #1866176
(cherry picked from commit 0be086fef5)
This commit is contained in:
Takashi Kajinami 2020-03-10 14:16:02 +09:00 committed by Tobias Urdin
parent 3bb858507f
commit e12561cadc
4 changed files with 18 additions and 14 deletions

View File

@ -45,16 +45,17 @@
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
if [ -f Gemfile ]; then
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install'
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
$GEM_HOME/bin/bundle install --without system_tests --retry 3
$GEM_HOME/bin/bundle exec rspec spec/acceptance
$GEM_BIN_DIR/bundle install --without system_tests --retry 3
$GEM_BIN_DIR/bundle exec rspec spec/acceptance
else
gem install rake -n ./.bundled_gems/ --no-user-instal
gem install beaker-rspec --no-user-install

View File

@ -19,18 +19,19 @@
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
if [ -f Gemfile ]; then
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install'
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
$GEM_HOME/bin/bundle install --without system_tests --retry 3
$GEM_HOME/bin/bundle exec rake lint 2>&1
$GEM_BIN_DIR/bundle install --without system_tests --retry 3
$GEM_BIN_DIR/bundle exec rake lint 2>&1
if [ -f metadata.json ]; then
$GEM_HOME/bin/bundle exec rake metadata_lint 2>&1
$GEM_BIN_DIR/bundle exec rake metadata_lint 2>&1
fi
else
gem install rake -n ./.bundled_gems/ --no-ri --no-rdoc --no-user-install

View File

@ -5,18 +5,19 @@
export PUPPET_GEM_VERSION='~> {{ puppet }}'
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install'
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
$GEM_HOME/bin/bundle install --retry 3
$GEM_BIN_DIR/bundle install --retry 3
# FUTURE_PARSER=yes is only supported by Puppet 3.x
if [ "{{ puppet }}" -lt "4" ]; then
export FUTURE_PARSER=yes
fi
$GEM_HOME/bin/bundle exec rake syntax
$GEM_BIN_DIR/bundle exec rake syntax
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -8,14 +8,15 @@
fi
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
export GEM_BIN_DIR=$GEM_HOME/bin
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install'
cmd = 'gem install bundler --no-rdoc --no-ri --verbose --no-user-install --bindir=${GEM_BIN_DIR}'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
$GEM_HOME/bin/bundle install --retry 3
$GEM_HOME/bin/bundle exec rake spec SPEC_OPTS='--format documentation'
$GEM_BIN_DIR/bundle install --retry 3
$GEM_BIN_DIR/bundle exec rake spec SPEC_OPTS='--format documentation'
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'