From 240e781fa59312db427786ad65bb6ad0f2f3241d Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Fri, 6 Jan 2023 13:22:02 +0100 Subject: [PATCH 1/6] add docker dev env --- .Rbuildignore | 2 +- .gitignore | 4 +--- docker-compose.yml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yml diff --git a/.Rbuildignore b/.Rbuildignore index 2c46fa8a..cdb8c934 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.travis.yml ^_pkgdown\.yml$ ^docs$ ^pkgdown$ @@ -12,3 +11,4 @@ ^appveyor\.yml$ ^\.lintr$ ^data-raw$ +^docker-compose.yml$ diff --git a/.gitignore b/.gitignore index d1e57080..e0841cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ .Rproj.user .Rhistory .RData -inst/doc -inst/jrxml/*.jasper vignettes/*.pdf -docs/ \ No newline at end of file +docs/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..fcb3d50e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.3' + +services: + db: + image: mysql:5.7 + command: --innodb-log-file-size=500M --innodb_strict_mode=0 + restart: "no" + environment: + MYSQL_ROOT_PASSWORD: root + + dev: + depends_on: + - db + image: rapporteket/dev:nightly + volumes: + - .:/home/rstudio/rapbase/ + - ~/.ssh:/home/rstudio/.ssh + - ~/.gitconfig:/home/rstudio/.gitconfig + ports: + - "8787:8787" + - "3838:3838" + dns: + - 8.8.8.8 + restart: "no" + environment: + PASSWORD: password + DB_HOST: db + DB_USER: root + DB_PASS: root + + adminer: + depends_on: + - db + image: adminer + restart: "no" + environment: + ADMINER_PLUGINS: frames + ports: + - 8888:8080 From 9684c164efe7445b14acbafe35a4c036576a7ec5 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Fri, 6 Jan 2023 14:18:35 +0100 Subject: [PATCH 2/6] dev env setup guide --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef3d0df9..49a5ab50 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,6 @@ remotes::install_github("Rapporteket/rapbase@*release") Or install the development version from GitHub with: ```r remotes::install("Rapporteket/rapbase") -``` -Alternatively, the package source code can be [cloned from GitHub](https://github.com/Rapporteket/rapbase) and built locally. ## Usage Once the package is installed functions can be called from within R, *e.g.*: @@ -43,6 +41,16 @@ Please provide any comments (*e.g.* on proposed enhancements, shortcomings, erro ## Contributing If you want to make changes to this project please follow the [Contributing guide](https://rapporteket.github.io/rapbase/CONTRIBUTING.html). Proposed changes will be processed based on manual code reviews. Code that is accepted will be merged into the main branch and used for full scale TESTING and QA prior to making a release for PRODUCTION deployment. +For kick-starting, a development environment set-up is included and may be applied if [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/) is at hand. After cloning *rapbase* the development environment can be startet from a terminal at the local work copy root directory by: +```bash +docker-compose up +``` +Navigate a browser to [localhost:8787](localhost:8787), log in to the [RStudio IDE](https://posit.co/products/open-source/rstudio/) and initiate the project by "clicking" the file *rapbase.Rproj* inside the *rapbase* directory. For development all suggested imports for the *rapbase* R package will be needed. To make sure these are installed use the R Console and run +```r +devtools::install_dev_deps() +``` +After installing has finished all should be set to start change-build-test iterations :rocket: + ## Ethics Please note that the 'rapbase' project is released with a [Contributor Code of Conduct](http://rapporteket.github.io/rapbase/CODE_OF_CONDUCT.html). From cccdfb8d29026d06cea37f0ae4f05047969273b2 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Fri, 6 Jan 2023 14:22:00 +0100 Subject: [PATCH 3/6] more on contributing --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2a4a5438..87252311 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Contributing to rapbase This outlines how to propose a change to rapbase. -For more detailed info about contributing to this, and other tidyverse packages, please see the -[**development contributing guide**](https://rstd.io/tidy-contrib). +For more detailed info about contributing, please see the +[**tidyverse development contributing guide**](https://rstd.io/tidy-contrib). ## Fixing typos From 67c01b2a26274763c20f79a913480082a9d493d4 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Fri, 13 Jan 2023 15:12:28 +0100 Subject: [PATCH 4/6] Create devcontainer.json --- .devcontainer/devcontainer.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..cee6d3ef --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {} + } +} From e1f29a28a503167009f9de6231f659ec2e5c15fb Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Mon, 16 Jan 2023 14:07:44 +0000 Subject: [PATCH 5/6] a very simple devcontainer --- .devcontainer/devcontainer.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cee6d3ef..5726be28 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,12 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2", + "image": "ghcr.io/rocker-org/devcontainer/r-ver:4", "features": { - "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {} - } + "ghcr.io/rocker-org/devcontainer-features/r-apt:latest": {}, + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "r-cran-rapbase" + } + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rocker-org/devcontainer-features/r-apt" + ] } From 03672a46c08817f930f738329bec87ee90ccf72f Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Mon, 16 Jan 2023 14:18:09 +0000 Subject: [PATCH 6/6] add some mapping --- .devcontainer/devcontainer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5726be28..29d13375 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,5 +8,9 @@ }, "overrideFeatureInstallOrder": [ "ghcr.io/rocker-org/devcontainer-features/r-apt" + ], + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/rstudio/.ssh,type=bind,consistency=cached", + "source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/rstudio/.gitconfig,type=bind,consistency=cached" ] }