2

我有一个正在执行脚本的管道,其中一些是 3 个第三方脚本。在这种情况下是 Fastlane 脚本。
现在在极少数情况下,Fastlane 脚本期望用户向标准输入输入值我的问题是如何检测脚本何时停止并等待输入。在这种情况下,我喜欢抛出错误并使任务失败。
这是管道任务:

 - script:  |
     fastlane release --verbose projectName:${{parameters.projectName}} 
     echo 'Done invoking Fastfile'
    #failOnStderr: false 
    workingDirectory: '$(System.ArtifactsDirectory)/ios_artifacts'
    displayName: 'run fastlane'

它以这种空闲状态堆叠:

2020-10-12T06:46:27.5309820Z INFO [2020-10-12 06:46:27.52]: [32m------------------[0m
2020-10-12T06:46:27.5310570Z INFO [2020-10-12 06:46:27.53]: [32m--- Step: sigh ---[0m
2020-10-12T06:46:27.5311280Z INFO [2020-10-12 06:46:27.53]: [32m------------------[0m
2020-10-12T06:46:27.5362760Z 
2020-10-12T06:46:27.5386680Z +-------------------------------------+------------------------------+
2020-10-12T06:46:27.5387580Z |                      [32mSummary for sigh 2.162.0[0m                      |
2020-10-12T06:46:27.5388330Z +-------------------------------------+------------------------------+
2020-10-12T06:46:27.5389160Z | username                            | xxxx@xxxx.com       |
2020-10-12T06:46:27.5389530Z | app_identifier                      | com.xxxx.xxxx |
2020-10-12T06:46:27.5389950Z | team_id                             | xxxx                   |
2020-10-12T06:46:27.5390320Z | adhoc                               | false                        |
2020-10-12T06:46:27.5390730Z | developer_id                        | false                        |
2020-10-12T06:46:27.5391490Z | development                         | false                        |
2020-10-12T06:46:27.5391860Z | skip_install                        | false                        |
2020-10-12T06:46:27.5392280Z | force                               | false                        |
2020-10-12T06:46:27.5392650Z | ignore_profiles_with_different_name | false                        |
2020-10-12T06:46:27.5393070Z | skip_fetch_profiles                 | false                        |
2020-10-12T06:46:27.5393450Z | skip_certificate_verification       | false                        |
2020-10-12T06:46:27.5393860Z | platform                            | ios                          |
2020-10-12T06:46:27.5394230Z | readonly                            | false                        |
2020-10-12T06:46:27.5394630Z | fail_on_name_taken                  | false                        |
2020-10-12T06:46:27.5395400Z +-------------------------------------+------------------------------+
2020-10-12T06:46:27.5395640Z 
2020-10-12T06:46:27.5396350Z INFO [2020-10-12 06:46:27.53]: Starting login with user 'xxxx@xxxx.com'
2020-10-12T06:46:27.5559840Z Reading keychain entry, because either user or password were empty
2020-10-12T06:46:27.5560420Z Loading session from environment variable
2020-10-12T06:46:27.7305500Z Session loaded from environment variable is not valid. Continuing with normal login.
2020-10-12T06:46:28.7278420Z Two-factor Authentication (6 digits code) is enabled for account 'xxxx@xxxx.com'
2020-10-12T06:46:28.7279570Z More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915
2020-10-12T06:46:28.7279880Z 
2020-10-12T06:46:28.7280520Z If you're running this in a non-interactive session (e.g. server or CI)
2020-10-12T06:46:28.7281300Z check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification

我如何监控这种状态?管道失败?

4

1 回答 1

1

我如何监控这种状态?管道失败?

据我所知,这是不可能的。目前,azure devops 管道不提供这样的内置功能,可以检测等待输入的脚本并导致管道失败。这应该是一种简单的方法来设置您想要的任务timeoutInMinutes: number # how long to wait before timing out the task超时,使其基于超时失败,但似乎您不想要这个。

您可以在我们的UserVoice网站上添加您对该功能的请求,这是我们产品建议的主要论坛。提出建议后,您可以对此反馈进行投票并添加您的评论。如果产品团队查看更新,他们将提供更新。

于 2020-10-13T08:00:31.953 回答