Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build process for dev/prod awareness #3

Open
mstackhouse opened this issue Feb 14, 2024 · 4 comments · May be fixed by #25
Open

Build process for dev/prod awareness #3

mstackhouse opened this issue Feb 14, 2024 · 4 comments · May be fixed by #25
Assignees

Comments

@mstackhouse
Copy link
Collaborator

mstackhouse commented Feb 14, 2024

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
Copy link
Collaborator

MayaGans commented Jul 2, 2024

  • jobs/data.rds is .gitignore
  • add this snippet to server.R add this snippet to data_prep.R

@MayaGans
Copy link
Collaborator

MayaGans commented Jul 2, 2024

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
Copy link
Collaborator

MayaGans commented Jul 3, 2024

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

@MayaGans
Copy link
Collaborator

MayaGans commented Jul 3, 2024

TODO - add jobs/data.rds to gitignore

@jiwanheo jiwanheo linked a pull request Jul 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants