Skip to content

Instantly share code, notes, and snippets.

@smach
Forked from ellisvalentiner/bitbucket-pipelines.yml
Last active January 25, 2023 18:48
Show Gist options
  • Save smach/2c390e84a1768ebf47ee34eea687f389 to your computer and use it in GitHub Desktop.
Save smach/2c390e84a1768ebf47ee34eea687f389 to your computer and use it in GitHub Desktop.
yaml to build R package for bitbucket pipelines continuous integration
image: rocker/tidyverse:latest
pipelines:
default:
- step:
script:
- cd /opt/atlassian/pipelines/agent/build
- Rscript -e 'devtools::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
- Rscript -e 'devtools::build()'
- Rscript -e 'devtools::install(upgrade_dependencies = FALSE)'
- Rscript -e 'devtools::check()'
@smach
Copy link
Author

smach commented Jan 25, 2023

Useful comment on the original from aboland-edge]:

I'm sure you found a solution long since this post, but it was one of the top hits when I googled this problem.

My library was in a sub directory in the repository, this was the problem. The solution was to set the directory to where the R library was.

script:
    - cd /opt/atlassian/pipelines/agent/build/my_R_library
    - Rscript -e 'devtools::install_deps(".", dependencies=TRUE, upgrade=FALSE)'
    - Rscript -e 'devtools::build()'
    - Rscript -e 'devtools::install(upgrade_dependencies = FALSE)'
    - Rscript -e 'devtools::check()'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment