From 2a240d86b9d435377b7453213878a6eaf6e1b303 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sat, 23 Dec 2023 09:11:31 +0800 Subject: [PATCH] Get basic devcontainer setup working (#2459) * Fix typo (devcontainers->devcontainer) * basic git extension * add requirements to Dockerfile * multi-line string instead * exclude standard packages * fix typo in Rbuildignore too * patrick too * Use remotes to encapsulate installation * simplify * combine 2nd+3rd install calls * even simpler * drop remotes * syntax * one more, spacing for clarity * Try COPY from parent directory * copy to '.' * try symlinking * no longer need COPY * or maybe I do? * i suck at symlink * i hate docker so much * hard-code deps * revert * trying build.context instead * git :( * Back to remotes * semicolon needed * Comment about '|>' + '_' (#2495) * rm obsolete * don't include Depends (just a distraction) * formatting * revert --------- Co-authored-by: AshesITR --- .Rbuildignore | 2 +- .devcontainer/Dockerfile | 14 ++++++++++++++ .devcontainer/devcontainer.json | 3 +++ .devcontainers/devcontainers.json | 3 --- DESCRIPTION | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainers/devcontainers.json diff --git a/.Rbuildignore b/.Rbuildignore index 416f1b10c..e609141bd 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,7 +8,7 @@ ^\.Rproj\.user$ ^\.idea$ ^\.dev$ -^\.devcontainers$ +^\.devcontainer$ ^\.lintr$ ^\.lintr_new$ ^wercker\.yml$ diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..768428f4c --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,14 @@ +FROM rocker/r-base + +RUN apt-get -qq update && \ + apt-get install -y --no-install-recommends git libxml2-dev + +COPY DESCRIPTION . + +RUN Rscript -e ' \ + install.packages("remotes"); \ + remotes::install_deps(dependencies = c( \ + "Imports", \ + "Config/needs/development" \ + )) \ +' diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..b30eaba32 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,3 @@ +{ + "build": { "dockerfile": "Dockerfile", "context": ".."} +} diff --git a/.devcontainers/devcontainers.json b/.devcontainers/devcontainers.json deleted file mode 100644 index 675ee26d3..000000000 --- a/.devcontainers/devcontainers.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "image": "rocker/r-base" -} diff --git a/DESCRIPTION b/DESCRIPTION index 4a46f62ef..c3857e4b3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,6 +52,7 @@ Enhances: VignetteBuilder: knitr Config/Needs/website: tidyverse/tidytemplate +Config/Needs/development: pkgload, cli, testthat, patrick Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE)