TFS Run Shell 不起作用:未找到 bash:null

TFS Run Shell 不起作用:未找到 bash:null

我正在嘗試在 TFS 2015 的發行版中執行 bash 腳本。

內容:

#!/bin/bash
echo "Start SSH"

ssh user@ip << EOF
    echo "Unzip"
    unzip -o -d A B.zip
    rm B.zip
    cp -r A/. B
    rm -rf A
    echo "Finished"
EOF

我已經在 bash 上嘗試過該腳本,並且運行正常,但是在運行版本時我得到了:

2018-08-29T09:04:08.7988672Z 啟動任務:Shell 腳本$(System.DefaultWorkingDirectory)/Build Magento/magento/scripts/build.sh 2018-08-29T09:04:08/build.sh 2018-082ZT09:04:08Z 將工作值設定為資料夾:D:\ AgentA\tasks\ShellScript\1.0.17
2018-08-29T09:04:08.9863750Z ##[調試]檢查路徑:D:\AgentA\tasks\ShellScript\1.0.17\task.json 2018-A\tasks\ShellScript\1.0.17\task.json
2018-008 -29T09:04 :08.9863750Z ##[debug]將資源檔案設定為:D:\AgentA\tasks\ShellScript\1.0.17\task.json
2018-08-29T09:04:08.9863750Z863750Z1 .culture=en- US
2018-08-29T09:04:08.9863750Z ##[偵錯]從下列位置載入字串:D:\AgentA\tasks\ShellScript\1.0.17\task.json
2018-08-29T09: 04:08.9863750Z ##[偵錯] 從下列位置載入loc 字串:D:\AgentA\tasks\ShellScript\1.0.17\Strings\resources.resjson\en-US\resources.resjson 2018-08-29T09:04 。
​-task-lib\lib.json 2018-08-29T09: 04:08.9863750Z ##[偵錯]從下列位置載入本機字串:D:\AgentA\tasks\ShellScript\1.0.17\node_modules\vsts-task- lib\Strings\resources.resjson\en-US\resources.resjson 2018- 08-29T09:04:08.9863750Z ##[debug]任務結果:失敗 2018-08-29T09
:04:08.9863750Z
-08-29T09:04:09.0019981Z 完成任務:ShellScript
2018-08- 29T09:04:09.0176245Z ##[錯誤]任務 ShellScript 失敗。這導致工作失敗。查看任務日誌以了解更多詳細資訊。

Bash 最終不在 TFS 2015 上嗎?

答案1

所以,我有一個解決方法。我在 CommandLine-Job 中使用 Plink。 Job呼叫Plink,Plink連線到目標並執行指定的命令。 Plink.exe 必須位於 TFS 上。

相關內容