R 停止Bitbucket管道中闪亮的应用程序
我在Bitbucket回购中有一个闪亮的应用程序,我想运行该应用程序,然后停止该应用程序。我的R 停止Bitbucket管道中闪亮的应用程序,r,shiny,bitbucket-pipelines,R,Shiny,Bitbucket Pipelines,我在Bitbucket回购中有一个闪亮的应用程序,我想运行该应用程序,然后停止该应用程序。我的比特桶管道.yml image: rocker/verse:3.5.0 pipelines: default: - step: script: - cd /opt/atlassian/pipelines/agent/build - Rscript -e 'install.packages(c("shiny", "googleAuthR", "
比特桶管道.yml
image: rocker/verse:3.5.0
pipelines:
default:
- step:
script:
- cd /opt/atlassian/pipelines/agent/build
- Rscript -e 'install.packages(c("shiny", "googleAuthR", "dplyr",
"googleAnalyticsR", "knitr", "rmarkdown", "jsonlite"),
repos = "https://cran.rstudio.com/")'
- Rscript -e 'shiny::runApp(appDir = file.path("/opt/atlassian/pipelines/agent/build/", "app"))'
- Rscript -e 'shiny::stopApp()'
所有加载和运行都成功,但最终生产线从未运行;管道位于shinny::runApp()
命令上:
管道将让应用程序运行,直到我手动停止管道
如何强制最后一个
shinny::stopApp()
运行并关闭应用程序,从而完成管道?尝试将run-app命令更改为:
-Rscript-e'shinny::runApp(appDir=file.path(“/opt/atlassian/pipelines/agent/build/”,“app”)&
这将在单独的进程中启动runapp命令 您可以使用
和运行它吗?看起来您的进程将被runapp命令卡住。确切地说是被runapp()
卡住了。如何使用&
添加stopApp()
命令?您可能希望在run-app命令中附加&
,以便它在后台运行,而不是在当前进程中运行。更多解释->完美。谢谢酷!注意:您可能需要加入某种反馈命令,因为理论上您可能会在它启动之前停止它。我最后添加了一个sleep 10
命令,以强制shinny::stoppp()
命令等待一段时间,以确保shinny应用程序实际运行。再次感谢!