【问题标题】:Cloud build trigger should not create the docker image based on git commit message云构建触发器不应基于 git commit 消息创建 docker 映像
【发布时间】:2021-12-14 02:30:32
【问题描述】:

如果用户使用提交消息“skip-docker-creation”提交代码,因此云构建管道不应创建 docker 映像,我们如何在管道中实现这一点?

【问题讨论】:

    标签: google-cloud-platform continuous-integration google-cloud-build cloudbuild.yaml


    【解决方案1】:

    解决了我把云构建代码放在这里给大家。

    步骤:

    • 名称:'gcr.io/cloud-builders/git' 入口点:'bash' args: [ '-c', 'commit_message=$(git log --format=%B -n 1) && echo "${commit_message}" > /workspace/commitmessage.txt']

    • 名称:'gcr.io/cloud-builders/docker' 入口点:'bash' 参数:

      • '-c'

      • | echo "然后我们保存了" $(cat /workspace/commitmessage.txt)

        if [ "$(cat /workspace/commitmessage.txt)" != "skip-docker-creation" ];然后 docker build -t 'gcr.io/xyzgration/1ykybaj0879c22' .
        别的 退出0; 菲

    【讨论】:

      猜你喜欢
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-10
      • 1970-01-01
      • 2020-05-20
      • 1970-01-01
      相关资源
      最近更新 更多