https://github.com/sol-eng/targets-deployment-rsc
https://github.com/sol-eng/targets-deployment-rsc
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sol-eng/targets-deployment-rsc
- Owner: sol-eng
- Created: 2021-02-23T20:56:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-12T13:18:42.000Z (over 4 years ago)
- Last Synced: 2024-08-06T03:03:26.293Z (almost 2 years ago)
- Language: R
- Size: 92.8 KB
- Stars: 12
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Deployment of a `targets` pipeline to RStudio Connect
### Setup
You have to set your environment variables in the environment. If you are developing locally you do this by executing:
```r
Sys.setenv("CONNECT_SERVER" = "XXXXX")
Sys.setenv("CONNECT_API_KEY" = "XXXXX")
```
Then you need to install the `renv` package and restore the snapshot so that you have all of the packages you need available.
```r
install.packages("renv")
renv::restore()
```
When you are publishing the pipeline to RStudio Connect, you deploy the content and the necessary environment variables will be in the environment without any human intervention.
### Running the pipeline
The `driver.Rmd` file drives the whole infrastructure build. One you knit that document the pipeline gets built. This file will generate an HTML report that is uploaded to RStudio Connect.
### Architecture & Files
- `driver.Rmd` executes the pipeline and acts as the parent environment
- `_targets.R` lays down the pipeline and the settings for it
- `report/report.Rmd` contains the report that will be published to RStudio Connect
- `R/connect_helpers.R` hosts the function to publish content to RStudio Connect
- `config.yml` specifies where to store the cache