Make sure we have a conference/environments/production.rb file so that
[arvados-dev.git] / jenkins / run-tests.sh
index 38290f777fb0ca29498b3fdc37104b447c8d5f6c..a646e361f5f0d4ab0b08a00e787c6e627e559a87 100755 (executable)
@@ -287,8 +287,9 @@ for tmpdir in VENVDIR VENV3DIR GOPATH GEMHOME
 do
     if [[ -n "${!tmpdir}" ]]; then
         leave_temp[$tmpdir]=1
+        mkdir -p "${!tmpdir}"
     else
-        eval $tmpdir=$(mktemp -d)
+        eval "$tmpdir"='$(mktemp -d)'
     fi
 done
 
@@ -358,7 +359,13 @@ with_test_gemset() {
     if [[ "$using_rvm" == true ]]; then
         "$@"
     else
-        GEM_HOME="$tmpdir_gem_home" "$@"
+        GEM_HOME="$tmpdir_gem_home" GEM_PATH="$tmpdir_gem_home" "$@"
+    fi
+}
+
+gem_uninstall_if_exists() {
+    if gem list "$1\$" | egrep '^\w'; then
+        gem uninstall --force --all --executables "$1"
     fi
 }
 
@@ -534,7 +541,7 @@ install_doc() {
 do_install doc
 
 install_ruby_sdk() {
-    with_test_gemset gem uninstall --force --all --executables arvados \
+    with_test_gemset gem_uninstall_if_exists arvados \
         && cd "$WORKSPACE/sdk/ruby" \
         && bundle_install_trylocal \
         && gem build arvados.gemspec \
@@ -543,7 +550,7 @@ install_ruby_sdk() {
 do_install sdk/ruby ruby_sdk
 
 install_cli() {
-    with_test_gemset gem uninstall --force --all --executables arvados-cli \
+    with_test_gemset gem_uninstall_if_exists arvados-cli \
         && cd "$WORKSPACE/sdk/cli" \
         && bundle_install_trylocal \
         && gem build arvados-cli.gemspec \