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

Source additional env vars from Renviron.site. #5552

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions deployments/datahub/images/default/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ RUN curl --silent --location --fail ${SHINY_SERVER_URL} > /tmp/shiny-server.deb
COPY Rprofile.site /usr/lib/R/etc/Rprofile.site
# RStudio needs its own config
COPY rsession.conf /etc/rstudio/rsession.conf
# Enable customizations to Renviron.site
COPY Renviron.site.append /tmp/Renviron.site.append
RUN cat /tmp/Renviron.site.append >> /etc/R/Renviron.site && \
mkdir /etc/R/Renviron.site.d/ && \
rm /tmp/Renviron.site.append

# R_LIBS_USER is set by default in /etc/R/Renviron, which RStudio loads.
# We uncomment the default, and set what we wanna - so it picks up
Expand Down
20 changes: 20 additions & 0 deletions deployments/datahub/images/default/Renviron.site.append
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## Source any extra Renviron files.
#
# Since there is an existing /etc/R/Renviron.site file, we append this. It lets
# us easily add new code via extraFiles (or other z2jh-related magic)
# without having to rebuild the image each time.


# Get a list of files in the directory
env_dir <- "/etc/R/Renviron.site.d/"
env_files <- list.files(env_dir, full.names = TRUE)

# Iterate over each file
for (env_file in env_files) {
cat("Loading environment variables from:", env_file, "\n")

# Read and parse the environment file
readRenviron(env_file)
}

Loading