English 中文(简体)
Github行动等待云层的建设完成。
原标题:Github action wait for cloud build to complete

我在使用高频指挥力时,从光布行动(GHA)中触发云层。

  - name: Start CB trigger
    run: |
      export CLOUDSDK_CORE_DISABLE_PROMPTS=1
      gcloud beta builds triggers run iaisudh983u4923 --branch=main

云层的建筑是同步启动的,全球卫生运动正在移动。 我希望全球艾滋病协会等到云层的修建,以完成处理工作,然后根据云层的建造是否成功——全球艾滋病协会应当这样做。

当我操作同样的<条码>gcloud beta造就触发器具在当地指挥时,我的行为相同。 指挥部成功执行,没有等待云层的修建才能完成执行。

最佳回答

In following code we trigger cloud build from GHA and then wait for status to be anything other then "QUEUED" or "WORKING"

To allow GHA to view logs from cloud build - grant role roles/logging.viewer to gha service account. This works only if logs are stored in logging and not in cloud storage bucket in the CB trigger yaml file

options:
 logging: CLOUD_LOGGING_ONLY

GHA code:

  - name: Start CB trigger to deploy main branch to dev GAE
    run: |
      export CLOUDSDK_CORE_DISABLE_PROMPTS=1
      BUILD_ID=$(gcloud beta builds triggers run ${{ vars.DEPLOY_DJANGO_TRIGGER_ID_DEV_2 }} 
        --branch=$branch --quiet 
        --format="value(metadata.build.id)")
      
      echo "BUILD_ID = $BUILD_ID"
      gcloud beta builds log --stream "$BUILD_ID"
      BUILD_STATUS=$(gcloud builds describe $BUILD_ID --format="value(status)")
      echo "Build status = $BUILD_STATUS"
      
      if [ "$BUILD_STATUS" == "SUCCESS" ]; then
          exit 0
      else
          exit 1
      fi
问题回答

暂无回答




相关问题
Unable to Setup Edge browser through github actions

I have an Selenium Automation project locally. As per project requirement I have to run the selenium project into Linux host machine using github actions for that I was trying to install the Edge ...

如何按顺序管理吉布工作流程?

我想按顺序安排我的基特霍工作流程。 为了更好地解释这一点,一旦以前的工作流程完成,下一个工作流程就会启动,而不是同时运行。

Building docker image is failing

I have created below docker file to install JDK 16.0.2 version and Jmeter 5.5. While pushing changes in GitHub the "Build Jmeter Docker Image" steps are getting failed: I could see following ...

热门标签