Deploy source package
To deploy a CRAN package to an Artifactory repository, use the Artifactory REST API. To deploy a source package, run the following command:
curl -L -u <USERNAME>:<PASSWORD> -T <PATH_TO_FILE> -XPOST \
"https://company.jfrog.io/artifactory/api/cran/cran-local/sources""https://<COMPANY>.jfrog.io/artifactory/api/cran/<REPOSITORY>/sources"Deploy binary package
To deploy a binary package, run the following command:
curl -L -u <USERNAME>:<PASSWORD> -T <PATH_TO_FILE> -XPOST \
"https://company.jfrog.io/artifactory/api/cran/cran-local/binaries?distribution=<DISTRIBUTION>&rVersion=<R_VERSION>"
Where:
<USERNAME>:<PASSWORD>: Your Artifactory credentials
<PATH_TO_FILE>: Local path to your .tar.gz CRAN package
<COMPANY> : Your organization or domain (e.g., productdemo)
<REPOSITORY>: Target CRAN repository name (e.g., cran-local)
<DISTRIBUTION>: Target distribution (e.g., linux, mac, windows)
<R_VERSION> : The R version for which the package is built
When deploying a CRAN binary package, you need to specify the distribution and R version as before.
When deploying directly (PUT request to a specific path), make sure the target path is a valid CRAN path:
/src/contribfor sources/
bin/{distribution}/contrib/{r-version}for binaries.
Deploying a package to a different path will not identify the package as a CRAN package and will not invoke the metadata indexing.