How to deploy 2 things (shiny app, scheduled Rmarkdown document) using devtools::load_all() to Posit Connect #1143
SimonCoulombe
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone,
I built my shiny app {myapp} following the {golem} framework. I built my app as a package and there is an
/app.R
file currently deployed to posit connect. I also created a Rmarkdown document located in/inst/rmd/publishme.Rmd
. This is rmarkdown generates some of the "main plots" using the functions in the package and will email them to me on a schedule.The shiny app works fine, but deploying this Rmd turns out to be quite troublesome . I can't give easily give it access to the functions in the {myapp} package.
My company uses RSPM, so in theory could deploy the package to RSPM and have
myapp
somewhere in my renv.lock file. However, the process to update our packages installed in the RSPM is manual and cumbersome, it involves jira tickets and waiting for another team to deploy the updated package in a few days. Not fun. So for the shiny app I kept the package {myapp} outside the renv.lock and the manifest.json and just useload_all()
:(content of app.R) :
However, this approach doesnt work for my
/inst/rmd/publishme.Rmd
on posit connect. I also putdevtools::load_all()
at the top ofpublishme.Rmd
. This works fine on my computer, but when I deploy to posit connect it doesnt have access to the parent directories containing the /DESCRIPTION and the function in /R . It think that is because I am deploying from/inst/rmd/manifest.json.
. I believe the publishme.Rmd file would work if I deployed it from/manifest.json
, but that json already points to the shiny app.Do you have any workaround for this that doesnt involve adding {myapp} to the renv.lock and manifest.json and updating the package on RSPM all the time I modify a function?
edit1: crossposted
here https://stackoverflow.com/questions/78551426/using-load-all-on-posit-connect-for-2-different-apps-in-the-same-repository-c
and there https://forum.posit.co/t/using-load-all-on-posit-connect-for-2-different-apps-in-the-same-repository-can-we-share-manifest-json/187323
edit2: error looks like this:
edit 3: found this solution. I'm afraid git backed RSPM is not a priority for the team that manages our posit connect server.
https://forum.posit.co/t/multiple-manifest-json-files-in-one-directory/71330/3
Beta Was this translation helpful? Give feedback.
All reactions