Upload a directory as a new versioned asset of a project in the Gobbler registry.

uploadDirectory(
  project,
  asset,
  version,
  directory,
  staging,
  url,
  probation = FALSE,
  consume = NULL,
  ignore.. = TRUE
)

Arguments

project

String containing an existing project name.

asset

String containing a new or existing asset name in project.

version

String containing the name of a new version of asset.

directory

String containing the path to a directory to be uploaded. This should be inside staging for best performance, typically using the directory allocated by allocateUploadDirectory. Otherwise, the contents of directory will be copied to staging prior to upload.

staging

String containing the path to the staging directory.

url

String containing the URL of the gobbler REST API.

probation

Logical scalar indicating whether to upload a probational version.

consume

Logical scalar indicating whether the contents of directory can be consumed by the upload process. If TRUE, the Gobbler will attempt to move files from directory into the registry. Otherwise, the contents of directory will not be modified by the upload. Defaults to TRUE if the contents of directory need to be copied to staging.

ignore..

Logical scalar indicating whether to skip dotfiles in directory during upload.

Value

On success, NULL is invisibly returned.

See also

createProject, to create a new project for uploads.

versionPath, to obtain the path to a versioned asset's contents inside the registry.

fetchManifest, to obtain the manifest of the versioned asset's contents.

Author

Aaron Lun

Examples

info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start with a clean slate.
createProject("test", info$staging, url=info$url)

src <- allocateUploadDirectory(info$staging)
write(file=file.path(src, "foo"), "BAR")

uploadDirectory(
    project="test", 
    asset="simple", 
    version="v1", 
    directory=src, 
    staging=info$staging,
    url=info$url
)