golem icon indicating copy to clipboard operation
golem copied to clipboard

Add a mechanism to help not add all files in rsconnect deployment

Open cderv opened this issue 5 years ago • 5 comments

This is a feature request to help users of golem and prevent sending heavy bundles when deploying.

Currently, golem suggests to use rsconnect::deployApp() but it says nothing about which files should be deployed. And the fact is all the files and folder are not necessary for a fully functionning app.

I am thinking about:

  • All the development only files and folder that golem creates like dev
  • All the files and folder helpful for package development but not for run (tests, data-raw, ...)
  • Everything that is in .Rbuildignore should not be needed when deployed.

The only mechanism I know in rsconnect is a file manifest or a appFiles argument. There is no .rsconnectIgnore. This could also be a feature request in rsconnect to have possibility to ignore some files instead of explicitly indicate them. Golem could then build on that.

For now, it would be either be

  • Just documentation to suggest that some files and folder are not required to be deploy
  • Using a file manifest to explictily state the files and folder that need to be deployed. As golem standardize the project folders, it could be easy For example, in a files_to_deploy.txt
inst/app
R
app.R
DESCRIPTION
NAMESPACE

and rsconnect::deployApp(appFileManifest = "files_to_deploy.txt")

(Note: Example to be tested but should work)

What do you think ?

cderv avatar Jul 07 '19 18:07 cderv

I think having a .rsconnectIgnore file would be a great addition to the reconnect package

slopp avatar Aug 05 '19 20:08 slopp

Putting this on-hold as there is (to my knowledge) no mechanism to handle that at RSconnect level.

ColinFay avatar Sep 04 '20 22:09 ColinFay

I wonder if app.R and the files_to_deploy.txt app manifest file could actually be stored in dev instead of the parent package directory?

aldomann avatar Oct 07 '20 14:10 aldomann

Not on hold anymore, see https://github.com/rstudio/rsconnect/pull/502

ColinFay avatar Nov 19 '21 09:11 ColinFay

TODO :

  • [ ] add_rscignore_file() that will add the files that do no need to be deployed to Connect:
    • [ ] Check that the {rsconnect} version is >= 0.8.25, skip the file writting if it is not
    • [ ] to ignore: dev/, man/, LICENSE, LICENCE, NEWS, NEWS.md, README.(md|Rmd|HTML), Vignette, tests (maybe others)
  • [ ] Run add_rscignore_file() in golem::add_rstudioconnect_file()

ColinFay avatar Jul 11 '22 09:07 ColinFay