Commit 64c27c8d authored by Pawel Piatek's avatar Pawel Piatek Committed by Konrad Sztyber
Browse files

scripts/vagrant: upload optional directories



Sometimes we need to copy additional directories with
sources into VM. Currently, two cases are known:
- spdk-abi
- dpdk (for CI vs-dpdk jobs)

Signed-off-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
Change-Id: I242838364d649b29a5a9dc720c6920493b061fa7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17645


Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent b16a4c22
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -83,11 +83,20 @@ def copy_vagrant_tools(config,files_sync_backend)
  config.vm.synced_folder src_path, "/home/vagrant/tools", files_sync_backend
end

def copy_spdk_dir(config, files_sync_backend)
def copy_sources_dirs(config, files_sync_backend)
  return unless ENV['COPY_SPDK_DIR'] == "1"
  return unless ENV['SPDK_DIR']

  config.vm.synced_folder ENV['SPDK_DIR'], '/home/vagrant/spdk_repo/spdk', files_sync_backend
  repo_prefix = '/home/vagrant/spdk_repo'
  config.vm.synced_folder ENV['SPDK_DIR'], "#{repo_prefix}/spdk", files_sync_backend

  # Optional directories
  for dir in ['spdk-abi', 'dpdk']
    src_path = "#{ENV['SPDK_DIR']}/../#{dir}"
    next unless File.directory?(File.expand_path(src_path))

    config.vm.synced_folder src_path, "#{repo_prefix}/#{dir}", files_sync_backend
  end
end

def copy_spdk_artifacts(config, plugins_sync_backend)
@@ -344,7 +353,7 @@ Vagrant.configure(2) do |config|
  # Copy in the user's tools if they exists
  copy_vagrant_tools(config,files_sync_backend)

  copy_spdk_dir(config, files_sync_backend)
  copy_sources_dirs(config, files_sync_backend)

  # rsync artifacts from build
  copy_spdk_artifacts(config, plugins_sync_backend)