Make gem install options explicit
The default behavior of `gem install` with regard to the location of the installed gems and binaries is different in CentOS7, CentOS8 and Ubuntu so let's make options explicit to get the desired behavior in all cases and configurations, what means getting gems installed under GEM_HOME to avoid depending on system wise PATH declarations and installed gems. Change-Id: I992a930491f65ba9871c3f94806afce54bef9c7b
This commit is contained in:
parent
c04064e289
commit
cf77be5c48
@ -64,7 +64,7 @@ print_header 'Install Bundler'
|
|||||||
mkdir -p .bundled_gems
|
mkdir -p .bundled_gems
|
||||||
export GEM_HOME=`pwd`/.bundled_gems
|
export GEM_HOME=`pwd`/.bundled_gems
|
||||||
ruby <<EOF
|
ruby <<EOF
|
||||||
cmd = 'gem install bundler --no-rdoc --no-ri --verbose'
|
cmd = 'gem install --no-user-install bundler --no-rdoc --no-ri --verbose'
|
||||||
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
|
||||||
cmd += ' -v 1.17.3'
|
cmd += ' -v 1.17.3'
|
||||||
end
|
end
|
||||||
|
@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
GEM_INSTALL_CMD="gem install --no-user-install --minimal-dep --verbose --no-ri --no-rdoc"
|
||||||
|
|
||||||
if [ -n "${GEM_HOME}" ]; then
|
if [ -n "${GEM_HOME}" ]; then
|
||||||
GEM_BIN_DIR=${GEM_HOME}/bin/
|
GEM_BIN_DIR=${GEM_HOME}/bin/
|
||||||
export PATH=${PATH}:${GEM_BIN_DIR}
|
export PATH=${PATH}:${GEM_BIN_DIR}
|
||||||
|
GEM_INSTALL_CMD="${GEM_INSTALL_CMD} --install-dir=$GEM_HOME --bindir=${GEM_BIN_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# NOTE(aschultz): since puppet 3 is now EOL, and beaker-puppet_install_helper
|
# NOTE(aschultz): since puppet 3 is now EOL, and beaker-puppet_install_helper
|
||||||
# version 0.6.0 has made the agent version the default, we need to symlink
|
# version 0.6.0 has made the agent version the default, we need to symlink
|
||||||
# puppet to the /opt/puppetlabs version when specifically not version 3.
|
# puppet to the /opt/puppetlabs version when specifically not version 3.
|
||||||
@ -24,13 +28,13 @@ source $SCRIPT_DIR/functions
|
|||||||
print_header 'Start (install_modules.sh)'
|
print_header 'Start (install_modules.sh)'
|
||||||
print_header 'Install r10k'
|
print_header 'Install r10k'
|
||||||
# fast_gettext 1.2.0+ requires ruby 2.1.0
|
# fast_gettext 1.2.0+ requires ruby 2.1.0
|
||||||
gem install fast_gettext -v '< 1.2.0' --verbose
|
$GEM_INSTALL_CMD fast_gettext -v '< 1.2.0'
|
||||||
# gettext 3.3.0+ requires ruby 2.5.0
|
# gettext 3.3.0+ requires ruby 2.5.0
|
||||||
gem install gettext -v '< 3.3.0' --verbose
|
$GEM_INSTALL_CMD gettext -v '< 3.3.0'
|
||||||
# puppet_forge 2.2.7 has a dependency on semantic_puppet ~> 1.0
|
# puppet_forge 2.2.7 has a dependency on semantic_puppet ~> 1.0
|
||||||
# which is not compatible with dependency of latest r10k on semantic_puppet ~> 0.1.0
|
# which is not compatible with dependency of latest r10k on semantic_puppet ~> 0.1.0
|
||||||
gem install puppet_forge -v '= 2.2.6' --verbose
|
$GEM_INSTALL_CMD puppet_forge -v '= 2.2.6'
|
||||||
gem install r10k -v 2.6.4 --no-ri --no-rdoc --verbose
|
$GEM_INSTALL_CMD r10k -v 2.6.4
|
||||||
|
|
||||||
# make sure there is no puppet module pre-installed
|
# make sure there is no puppet module pre-installed
|
||||||
rm -rf "${PUPPETFILE_DIR:?}/"*
|
rm -rf "${PUPPETFILE_DIR:?}/"*
|
||||||
|
Loading…
Reference in New Issue
Block a user