Azure Devops内联bash脚本子shell输出作为任务组的变量

时间:2018-12-04 17:24:11

标签: bash azure azure-devops azure-pipelines azure-pipelines-release-pipeline

我在运行嵌入式bash脚本的Azure DevOps上的代理作业中有一个任务。它所做的部分工作是读取文件的内容并将其分配给变量:

$(<artifact/drop/myfile.txt)

我想将此任务作为任务组的一部分,但是当我从任务创建任务组时,它会将Sub filter() Dim Bookrunner As String Dim Bond_Type As Variant Dim Currency_st As String Dim Year_Issue As Integer Bond_Type = InputBox("Choose a Bond Type", "Bond Type") Currency_st = InputBox("Choose a Currency", "Currency") Year_Issue = InputBox("Chosse the Year of Issuance", "Issue") Bookrunner = InputBox("Choose a Bookrunner", "Bookrunner") Dim copyFrom As Range Dim i As Long With Feuil1 For i = 2 To 54 If .Range("B" & i) = Bond_Type And _ .Range("K" & i) = Currency_st And _ .Range("D" & i).Value = Year_Issue And _ (.Range("R" & i) = Bookrunner Or .Range("S" & i) = Bookrunner Or _ .Range("T" & i) = Bookrunner Or .Range("U" & i) = Bookrunner Or _ .Range("V" & i) = Bookrunner Or .Range("w" & i) = Bookrunner) Then If copyFrom Is Nothing Then Set copyFrom = .Range("B" & i) Else Set copyFrom = Union(.Range("B" & i), copyFrom) End If End If Next End With If Not copyFrom Is Nothing Then copyFrom.EntireRow.Copy Destination:=Sheets("Feuil2").Range("A2") End Sub 标识为变量并将其自动添加到该任务组的变量列表中。

enter image description here

有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:0)

按如下所示设置变量:

filecontent=`cat artifact/drop/myfile.txt`