@@ -57,7 +57,7 @@ variables:
57
57
- ' .vendor'
58
58
before_script :
59
59
# Print important environment variables that may affect this job
60
- - ' ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=((e.map{|x| x.size}.max||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)"'
60
+ - ' ruby -e "puts %(\n\n), %q(=)*80, %(\nSIMP-relevant Environment Variables:\n\n#{e=ENV.keys.grep(/^PUPPET|^SIMP|^BEAKER|MATRIX/); pad=((e.map{|x| x.size}.max||0)+1); e.map{|v| %( * #{%(#{v}:).ljust(pad)} #{39.chr + ENV[v] + 39.chr}\n)}.join}\n), %q(=)*80, %(\n\n)" || : '
61
61
62
62
- echo -e "\e[0Ksection_start:`date +%s`:before_script10[collapsed=true]\r\e[0KDiagnostic ruby & gem information"
63
63
# Diagnostic ruby & gem information
@@ -69,13 +69,11 @@ variables:
69
69
70
70
# If RVM is available, make SURE it's using the right Ruby:
71
71
# * Source rvm (to run in non-login shells)
72
- # * If any $MATRIX_RUBY_VERSION rubies are available, use the latest
73
- # * Otherwise: install & use ${MATRIX_RUBY_VERSION}-head (e.g., latest)
74
- # * ^^ This could be wonky and introduce variations across runners
75
- # * ^^ maybe it should just fail if there is no $MATRIX_RUBY_VERSION installed?
72
+ # * Use $MATRIX_RUBY_VERSION ruby, install if not present
76
73
- echo -e "\e[0Ksection_start:`date +%s`:before_script20[collapsed=true]\r\e[0KEnsure RVM & ruby is installed"
77
- - " command -v rvm && { if declare -p rvm_path &> /dev/null; then source \" ${rvm_path}/scripts/rvm\" ; else source \" $HOME/.rvm/scripts/rvm\" || source /etc/profile.d/rvm.sh; fi; }"
78
- - " command -v rvm && { LATEST_RVM_RUBY_XY=\" $(rvm ls | grep \" $MATRIX_RUBY_VERSION\" | tail -1 | sed -e 's/^.*\\ ([0-9]\\ +\\ .[0-9]\\ +\\ .[0-9]\\ +\\ ).*$/\\ 1/g')\" ; if [ -z \" $LATEST_RVM_RUBY_XY\" ]; then LATEST_RVM_RUBY_XY=\" ${MATRIX_RUBY_VERSION}-head\" ; rvm install \" $LATEST_RVM_RUBY\" --no-docs; else echo \" Found RVM Ruby: '${LATEST_RVM_RUBY_XY}'\" ; fi; rvm use \" $LATEST_RVM_RUBY_XY\" ; }"
74
+ - " if command -v rvm; then if declare -p rvm_path &> /dev/null; then source \" ${rvm_path}/scripts/rvm\" ; else source \" $HOME/.rvm/scripts/rvm\" || source /etc/profile.d/rvm.sh; fi; fi"
75
+ - " if command -v rvm && ! grep rvm_install_on_use_flag=1 ~/.rvmrc; then echo rvm_install_on_use_flag=1 >> ~/.rvmrc || echo '== WARNING: ~/.rvmrc is missing rvm_install_on_use_flag=1 and I failed to add it'; fi"
76
+ - " if command -v rvm; then rvm use \" $MATRIX_RUBY_VERSION\" ; else echo \" rvm not detected; skipping 'rvm use'\" ; fi"
79
77
- ' ruby --version || :'
80
78
- ' gem list sync || :'
81
79
- echo -e "\e[0Ksection_end:`date +%s`:before_script20\r\e[0K"
0 commit comments