如何$BUILD_VERSION在 Gitlab CI 中不同管道的作业之间传递数据(例如变量)?
所以(就我而言):
\nPipeline 1 on push ect. Pipeline 2 after merge\n\n `building` job ... `deploying` job\n \xe2\x94\x82 \xe2\x96\xb2\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 $BUILD_VERSION \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\nRun Code Online (Sandbox Code Playgroud)\n考虑以下示例(完整内容yml如下):
Pipeline 1 on push ect. Pipeline 2 after merge\n\n `building` job ... `deploying` job\n \xe2\x94\x82 \xe2\x96\xb2\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 $BUILD_VERSION \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\nRun Code Online (Sandbox Code Playgroud)\n我有两个阶段,登台和部署。暂存阶段building的工作构建应用程序并创建一个“审查应用程序”(为了简单起见,没有单独的构建阶段)。然后,部署中的作业会上传新应用程序。deploying
building每当打开合并请求时,包含作业的管道就会运行。这样,应用程序就构建完成了,开发人员可以单击合并请求中的“审核应用程序”图标。该deploying作业在合并请求合并后立即运行。这个想法如下:
*staging* stage (pipeline 1) *deploy* …Run Code Online (Sandbox Code Playgroud)