在Bitbucket管道中停止闪亮的应用程序

时间:2018-08-15 19:52:55

标签: r shiny bitbucket-pipelines

我在Bitbucket存储库中有一个闪亮的应用程序,我想先运行然后在管道中停止该应用程序。我的bitbucket-pipelines.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()'

所有内容都能成功加载并运行,但最后一行永远不会运行;管道位于shiny::runApp()命令上:

enter image description here

管道只会让应用程序运行,直到我手动停止管道为止。

如何强制最后一个shiny::stopApp()运行并关闭应用程序,从而结束管道?

1 个答案:

答案 0 :(得分:3)

尝试将run app命令更改为:

- Rscript -e 'shiny::runApp(appDir = file.path("/opt/atlassian/pipelines/agent/build/", "app"))' &

这将在单独的过程中启动run app命令。