Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 停止Bitbucket管道中闪亮的应用程序_R_Shiny_Bitbucket Pipelines - Fatal编程技术网

R 停止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", "

我在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", "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应用程序实际运行。再次感谢!