Estou tentando executar um script bash no lançamento do TFS 2015. Para estes, estou usando o "Shell Script" - Job.
Contente:
#!/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
Eu tentei o script no meu bash e ele funciona corretamente, mas ao executar o lançamento, obtive:
2018-08-29T09:04:08.7988672Z Iniciando tarefa: Shell Script $(System.DefaultWorkingDirectory)/Build Magento/magento/scripts/build.sh 2018-08-29T09:04:08.7988672Z Defina workingFolder como padrão: D:\ AgentA\tasks\ShellScript\1.0.17
2018-08-29T09:04:08.9863750Z ##[debug]verifique o caminho: D:\AgentA\tasks\ShellScript\1.0.17\task.json
2018-08-29T09:04 :08.9863750Z ##[debug]defina o arquivo de recurso para: D:\AgentA\tasks\ShellScript\1.0.17\task.json
2018-08-29T09:04:08.9863750Z ##[debug]system.culture=en- US
2018-08-29T09:04:08.9863750Z ##[debug]carrega strings de: D:\AgentA\tasks\ShellScript\1.0.17\task.json
2018-08-29T09:04:08.9863750Z ##[debug ] carregar strings loc de: D:\AgentA\tasks\ShellScript\1.0.17\Strings\resources.resjson\en-US\resources.resjson 2018-08-29T09:04:08.9863750Z ##[debug]verificar caminho: null
2018-08-29T09:04:08.9863750Z ##[debug]carrega strings de: D:\AgentA\tasks\ShellScript\1.0.17\node_modules\vsts-task-lib\lib.json 2018-08-29T09: 04:08.9863750Z ##[debug]carregar strings loc de: 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]resultado da tarefa: Falha
2018-08-29T09:04:08.9863750Z Não encontrado bash: null
2018-08-29T09:04:09.0019981Z Concluindo tarefa: ShellScript
2018-08- 29T09:04:09.0176245Z ##[erro]Falha no ShellScript da tarefa. Isso fez com que o trabalho falhasse. Consulte os logs da tarefa para obter mais detalhes.
Eventualmente o Bash não está no TFS 2015?
Responder1
Então, eu tenho uma solução alternativa. Estou usando o Plink no CommandLine-Job. O Job chama Plink e Plink se conecta ao destino e executa os comandos especificados. O Plink.exe deve estar no TFS.