diff --git a/lib/backends/s3.bash b/lib/backends/s3.bash index e6e1c38..c39d338 100644 --- a/lib/backends/s3.bash +++ b/lib/backends/s3.bash @@ -138,6 +138,10 @@ function restore() { function cache() { TAR_FILE="${CACHE_KEY}.${BK_TAR_EXTENSION}" if [ "${BK_CACHE_SAVE_CACHE}" == "true" ]; then + if [ ! -d "${BK_CACHE_LOCAL_PATH}" ]; then + mkdir -p "${BK_CACHE_LOCAL_PATH}" + fi + TAR_FILE="${BK_CACHE_LOCAL_PATH}/${TAR_FILE}" fi BUCKET="${BUILDKITE_PLUGIN_CACHE_S3_BUCKET}/${BUILDKITE_ORGANIZATION_SLUG}/$(pipeline_slug)"