如何在Cloud Build的一个构建步骤中运行多个dotnet命令?

时间:2019-12-12 04:41:12

标签: .net-core google-cloud-platform google-cloud-build

我正在尝试使用Cloud Build构建我的.net核心项目。解决方案中存在一些测试项目,我想在构建步骤中运行测试。在cloudbuild.yaml文件中,我尝试执行此操作,但似乎Cloud Build不喜欢它:

- name: "gcr.io/cloud-builders/dotnet"
  entrypoint: "dotnet"
  args:
    - |
        test --no-build -c ${_BUILD_CONFIG} $REPO_NAME.Tests
        test --no-build -c ${_BUILD_CONFIG} $REPO_NAME.Common.Tests

所以我想知道如何在一个构建步骤中合并多个dotnet命令?

1 个答案:

答案 0 :(得分:1)

- name: "gcr.io/cloud-builders/dotnet"
  entrypoint: 'bash'
  args:
    - '-c'
    - |
        dotnet test --no-build -c ${_BUILD_CONFIG} $REPO_NAME.Tests
        dotnet test --no-build -c ${_BUILD_CONFIG} $REPO_NAME.Common.Tests

尝试

相关问题