我正在尝试构建android应用,然后通过以下方式将工件上传到另一台服务器:
到目前为止,我有两个阶段build
和deploy
。因此,一旦构建成功并且上传了工件,部署作业便会开始,它应该能够传递build
工件的作业ID(工件名称是全局var),这将最终卷曲我的php页面以启动下载。这是我的gitlab ci配置:
stages:
- buildRelease
- deploy
variables:
fileName: artifact-Name.apk
buildReleaseApp:
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- chmod +x ./gradlew
- echo $setUpBuildScript | base64 -d > buildRelease.sh
- chmod +x prepareConfig.sh
stage: buildRelease
script:
- sh buildRelease.sh
only:
- tags
artifacts:
paths:
- app/build/outputs/apk/playstore/release/*.apk
after_script:
- mv app/build/outputs/apk/playstore/release/*.apk app/build/outputs/apk/playstore/release/${fileName}
deployReleaseApp:
variables:
dependencies:
- buildReleaseApp
stage: deploy
only:
- tags
script:
- echo $pushScript | base64 -d > deploy.sh
- sh deploy.sh
除了php接收部署作业的ID,并且当php尝试下载build
工件时,一切都对我有用。
反正有将buildRelease
阶段的作业ID传递给deploy
作业吗?
答案 0 :(得分:0)
这可以帮助...
yourShape
您可以在其他阶段访问此job.env并调用$ JOB_ID以获取有关的工作ID和状态