diff --git a/.devcontainer/install.R b/.devcontainer/install.R old mode 100644 new mode 100755 index 74dacdb..671eff4 --- a/.devcontainer/install.R +++ b/.devcontainer/install.R @@ -1,11 +1,11 @@ +#! /usr/local/bin/Rscript # install R dependencies # We could use renv.lock approach here instead, but will force re-creation of environment from scratch # Does not provide a good way to ensure that sf/terra/gdalcubes are installed from source while other packages can be binary -install.packages(c("rstac", "spData")) -remotes::install_github("boettiger-lab/earthdatalogin") +install.packages(c("rstac", "spData", "earthdatalogin", "quarto")) remotes::install_github('r-tmap/tmap') -#install.packages(c("IRkernel", "languageserver", "httpgd")) -#IRkernel::installspec() +install.packages(c("IRkernel", "languageserver", "httpgd")) +IRkernel::installspec() diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 4a19cee..b89dcf1 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -2,11 +2,5 @@ sudo cp /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf sudo sudo bash -c 'echo "USER=rstudio" >>/etc/environment' -sudo /init & - -## set startup dir -mkdir -p ~/.local/share/rstudio/projects_settings -export RPROJ"=$(ls ${CODESPACE_VSCODE_FOLDER}/*.Rproj)" -echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path - +sudo /init &> /dev/null & diff --git a/.devcontainer/welcome.sh b/.devcontainer/welcome.sh index bcb3403..89aab9b 100755 --- a/.devcontainer/welcome.sh +++ b/.devcontainer/welcome.sh @@ -1,3 +1,8 @@ +mkdir -p ~/.local/share/rstudio/projects_settings +export RPROJ"=$(ls ${CODESPACE_VSCODE_FOLDER}/*.Rproj)" +echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path + + # Construct the message message="## [Open in RStudio](https://$CODESPACE_NAME-8787.app.github.dev) " diff --git a/.gitpod-setup.sh b/.gitpod-setup.sh new file mode 100644 index 0000000..0237b69 --- /dev/null +++ b/.gitpod-setup.sh @@ -0,0 +1,7 @@ +sudo useradd rstudio -u 1000 -s /bin/bash +mkdir -p ~/.local/share/rstudio/projects_settings +sudo mkdir -p /home/rstudio/.local/share/rstudio/projects_settings +export RPROJ"=$(ls -d $PWD/*.Rproj)" +sudo echo ${RPROJ} > ~/.local/share/rstudio/projects_settings/last-project-path +sudo cp ~/.local/share/rstudio/projects_settings/last-project-path /home/rstudio/.local/share/rstudio/projects_settings/last-project-path +sudo chown -R rstudio:rstudio /home/rstudio/.local/share/rstudio diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..b3b1868 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +image: ghcr.io/boettiger-lab/nasa-tops:latest +tasks: + - name: rstudio-init + init: bash .devcontainer/setup.sh + - name: setup + init: bash .gitpod-setup.sh + - name: rstudio-server + init: sudo rstudio-server start \ No newline at end of file