atorus-research / matte

{usethis} style tooling to help with Shiny applications evolving maturing into production systems
https://atorus-research.github.io/matte/
Other
4 stars 0 forks source link

Build process for dev/prod awareness #3

Open mstackhouse opened 7 months ago

mstackhouse commented 7 months ago

Leverage an active env variable to determine if working in dev area or prod area

If working in dev area, use a dev data folder for data caching (if necessary). If prod, look at the production area process

The temporary folder can be created or configurable into a location outside the parent git repository.

Throw a warning if the location is present in the git repository and advise the user to add folder to .gitignore

MayaGans commented 3 months ago
MayaGans commented 3 months ago
 metadata <- make_metadata_store("jobs/meta.yaml")
 session$userData[["metadata"]] <- metadata

  # read in transformed data from wherever
  if (Sys.getenv("R_CONFIG_ACTIVE") == "rsconnect" || isTRUE(golem::app_prod())) {
    data <- readRDS(file.path(metadata$meta$datapath, "ADaM", "data.rds"))
  } else {
    data <- readRDS(here::here("jobs/data.rds"))
  }
MayaGans commented 3 months ago

Maybe a helper function that looks for the file path for .rds in .Renviron OR YAML?

MayaGans commented 3 months ago

TODO - add jobs/data.rds to gitignore