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
This commit is contained in:
Takashi Kajinami 2020-03-10 14:16:02 +09:00
parent 4c4d155ba3
commit 0be086fef5
4 changed files with 17 additions and 13 deletions

View File

@ -48,16 +48,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,14 +5,15 @@
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_HOME/bin/bundle exec rake syntax
$GEM_BIN_DIR/bundle install --retry 3
$GEM_BIN_DIR/bundle exec rake syntax
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -17,14 +17,15 @@
export STRICT_VARIABLES=no
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 }}'