#!/bin/bash -l
set -e

env | sort                      # so we know what variables are present.

git clean -df && git checkout . # ensure that any modifications or stray files are removed
rm -rf .bundle                  # Cleanup any left over gems and bundler config

# BUILD_FLOW_GIT_COMMIT gets set in the bosh_build_flow jenkins jobs.
# This ensures we check out the same git commit for all jenkins jobs in the flow.
if [ -n "$BUILD_FLOW_GIT_COMMIT" ]; then
    git checkout $BUILD_FLOW_GIT_COMMIT
fi

bundle install --without development --local --path "/tmp/${BUILD_TAG}"

bundle exec rake --trace ci:setup:rspec $@

#!/bin/bash -l
set -e

env | sort                      # so we know what variables are present.

git clean -df && git checkout . # ensure that any modifications or stray files are removed
rm -rf .bundle tmp              # Cleanup any left over gems and bundler config

# BUILD_FLOW_GIT_COMMIT gets set in the bosh_build_flow jenkins jobs.
# This ensures we check out the same git commit for all jenkins jobs in the flow.
if [ -n "$BUILD_FLOW_GIT_COMMIT" ]; then
    git checkout $BUILD_FLOW_GIT_COMMIT
fi

bundle install --without development --local --path tmp/ruby

bundle exec rake --trace ci:setup:rspec $@

--- 
+++ 
@@ -4,7 +4,7 @@
 env | sort                      # so we know what variables are present.
 
 git clean -df && git checkout . # ensure that any modifications or stray files are removed
-rm -rf .bundle tmp              # Cleanup any left over gems and bundler config
+rm -rf .bundle                  # Cleanup any left over gems and bundler config
 
 # BUILD_FLOW_GIT_COMMIT gets set in the bosh_build_flow jenkins jobs.
 # This ensures we check out the same git commit for all jenkins jobs in the flow.
@@ -12,6 +12,6 @@
     git checkout $BUILD_FLOW_GIT_COMMIT
 fi
 
-bundle install --without development --local --path tmp/ruby
+bundle install --without development --local --path "/tmp/${BUILD_TAG}"
 
 bundle exec rake --trace ci:setup:rspec $@
Move the bundle path outside the workspace (e.g. bosh/) so that rubocop doesn't lint gems
