publish_resource: A function that publishes resource to the hub S3 bucket

View source: R/publish_resource.R

publish_resourceR Documentation

A function that publishes resource to the hub S3 bucket

Description

This function uses functionality from the aws.s3 package to put files or directories on the Bioconductor's test hub S3 bucket. The user should have already contacted the hubs maintainers at hubs@bioconductor.org to get the necessary credentials to access the bucket. These credentials should be delcared in the system environment prior to running this function.

Usage

publish_resource(path, object, dry.run = TRUE)

Arguments

path

A character(1) path to the file or the name of the directory to be added to the bucket. If adding a directory, be sure there are no nested directories and only files within it.

object

A character(1) to indicate how the file should be named on the bucket.

dry.run

A boolean to indicate if the resource should in fact be published. The defalut is TRUE, meaning the resource won't be published.

Value

None

Examples

pkgdir <- tempfile()
fl1 <- file.path(pkgdir, "mtcars1.csv")
dir.create(dirname(fl1), recursive = TRUE)
write.csv(mtcars, file = file.path(fl1))
fl2 <- file.path(pkgdir, "mtcars2.csv")
write.csv(mtcars, file = file.path(fl2))
publish_resource(pkgdir, "test_dir")

fl3 <- file.path(pkgdir, "mtcars3.csv")
write.csv(mtcars, file = file.path(fl3))
publish_resource(fl3, "test_dir")

Bioconductor/HubPub documentation built on Nov. 1, 2024, 11:02 p.m.