Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SciViews
svbox-renku
Commits
dbd8be47
Commit
dbd8be47
authored
Sep 20, 2021
by
Philippe Grosjean
Browse files
Update Dockerfile
parent
b5d4ba58
Pipeline
#254916
failed with stage
in 22 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
dbd8be47
...
...
@@ -73,85 +73,8 @@ COPY requirements.txt /tmp/
RUN
R
-f
/tmp/install.R
&&
\
R
--quiet
-e
"install.packages('webshot'); webshot::install_phantomjs()"
&&
\
pip3
install
-r
/tmp/requirements.txt
&&
\
echo
'svMisc::assign_temp("renku_save", function(renku_dir = NULL, commit = TRUE) {
# Get the root directory of the Renku/GitLab project
renku_get_dir <- function() {
if (fs::file_exists("~/.config/renkudir")) {
trimws(readLines("~/.config/renkudir")[1])
} else {
# Use reasonable default value
"~/mybox"
}
}
# The Renku/GitLab root directory
if (is.null(renku_dir))
renku_dir <- renku_get_dir()
# The directory where to place the configuration
config_dir <- fs::path(renku_dir, ".config")
if (!fs::dir_exists(config_dir))
fs::dir_create(config_dir)
# Record RStudio configuration in my repo
rstudio_conf <- fs::path("~/.config/rstudio/rstudio-prefs.json")
if (fs::file_exists(rstudio_conf))
fs::file_copy(rstudio_conf, fs::path(config_dir, "rstudio-prefs-user.json"),
overwrite = TRUE)
# Record project MRU (only for ~/github/ items)
project_mru <- fs::path("~/.rstudio/monitored/lists/project_mru")
if (fs::file_exists(project_mru)) {
mru <- readLines(project_mru)
mru <- mru[grepl("^~/github/", mru)]
project_mru_save <- fs::path(config_dir, "project_mru")
if (!length(mru)) {
if (fs::file_exists(project_mru_save))
fs::file_delete(project_mru_save)
} else {
# There is something to save
writeLines(mru, project_mru_save)
}
}
# Record the list of ~/github/ subdirectories and their corresponding repos
gh_dir <- fs::path("~/github")
project_paths <- unlist(fs::dir_map(gh_dir, recurse = 1, type = "directory",
fun = function(dir) {
# This is a git project if there is an .Rproj file and a remote is defined
remote_url <- try(gert::git_remote_info(repo = dir)$url, silent = TRUE)
if (length(fs::dir_ls(dir, type = "file", glob = "*.Rproj")) &&
!inherits(remote_url, "try-error")) {
paste(dir, remote_url, sep = "|")
}
}))
project_paths_save <- fs::path(config_dir, "project_paths")
if (!length(project_paths)) {
if (fs::file_exists(project_paths_save))
fs::file_delete(project_paths_save)
} else {
# There are repos to record
writeLines(project_paths, project_paths_save)
}
# Save the new config
odir <- setwd(renku_dir)
on.exit(setwd(odir))
if (isTRUE(commit)) {
system("renku save")
#system('git add .')
#system('git commit -m "Save RStudio configuration"')
#system('git push')
}
})
setHook("rstudio.sessionInit", function(newSession) {
if (newSession) {
renku_save(commit = FALSE)
}
}, action = "append")
' | sudo tee -a $(R RHOME)/etc/Rprofile.site > /dev/null
curl
-sL
https://filedn.com/lzGVgfOGxb6mHFQcRn9ueUb/svbox2021/files/Rprofile.site.append
>
/home/rstudio/.config/Rprofile.site.append
&&
\
cat
/home/rstudio/.config/Rprofile.site.append |
sudo tee
-a
$(
R RHOME
)
/etc/Rprofile.site
>
/dev/null
COPY
post-init.sh /post-init.sh
ENTRYPOINT
[ "/tini", "--", "/entrypoint.sh" ]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment