0

悬挂管道

我使用了以下 yml 内容。使用蓝铜矿 3.15 和 3.9。但没有运气。然后我尝试了单独的工作。仍然无法通过集成测试。

 stages:
    - stage: Publish
      displayName: 'Build and Publish Artifacts'
      jobs:
      - job: 'NGKMediaManagementAPI'
        steps:
        - task: NodeTool@0 
          inputs:
             versionSpec: 13.x
        - script : npm install -g azurite@3.9.0
        - script : mkdir azurite
        - script : azurite
4

2 回答 2

0

启动 Azurite 时,默认设置是阻止您正在运行它的命令提示符,这会使管道看起来挂起。

从 PowerShell 运行命令并使用后台运算符启动后台作业

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      npm install -g azurite
      azurite &

详细信息:使用 Azurite 运行自动化测试 - 在 Azure Pipelines 上运行测试。在此示例中,他们使用& operatorin Bash 也指示 shell 在后台运行命令。

其他有趣的命令是Get-JobStop-JobRemove-Job

于 2022-02-08T08:43:09.087 回答
0

解决了挂起问题并通过了管道中的初始化测试(基于 Azurite)。在您的 yml 文件中使用以下命令。最重要的是start /B azurite将消除悬挂问题!

 - task: NodeTool@0 
      inputs:
         versionSpec: 13.x
    - script : npm install -g azurite
      displayName: Install Azurite
    - script : start /B azurite
      displayName: Start azurite

下面是成功的管道在此处输入图像描述

于 2022-02-11T17:26:56.633 回答