Я добавил задачу в конвейеры Azure, цель задачи - включить WinRM на удаленных серверах Windows.
Определение задачи приведено ниже:
set -x
pwd
"cd $(System.DefaultWorkingDirectory)/_Terraform Build Phase/drop/terraform/scripts"
echo $/
sudo ./temp.sh
echo $?
Я пробовал разные переменныено все же не повезло, проблема в том, что он не может изменить каталог из-за пробелов, у меня есть двойные кавычки вокруг него, но все еще не работает, может быть, я не использую правильную переменную PreDefined?
Сообщение об ошибкекак показано ниже:
2019-02-25T23:39:09.5826778Z ==============================================================================
2019-02-25T23:39:09.5826827Z Task : Command Line
2019-02-25T23:39:09.5826855Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-02-25T23:39:09.5826885Z Version : 2.146.1
2019-02-25T23:39:09.5827075Z Author : Microsoft Corporation
2019-02-25T23:39:09.5827104Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2019-02-25T23:39:09.5827131Z ==============================================================================
2019-02-25T23:39:09.7013466Z Generating script.
2019-02-25T23:39:09.7057060Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/69f83a50-dbda-4ddc-a5ac-d658cebf6030.sh
2019-02-25T23:39:09.7110679Z /home/vsts/work/r1/a
2019-02-25T23:39:09.7110949Z $/
2019-02-25T23:39:09.7115232Z + pwd
2019-02-25T23:39:09.7115916Z + 'cd /home/vsts/work/r1/a/_Terraform Build Phase/drop/terraform/scripts'
2019-02-25T23:39:09.7116546Z /home/vsts/work/_temp/69f83a50-dbda-4ddc-a5ac-d658cebf6030.sh: line 3: cd /home/vsts/work/r1/a/_Terraform Build Phase/drop/terraform/scripts: No such file or directory
2019-02-25T23:39:09.7117181Z + echo '$/'
2019-02-25T23:39:09.7117272Z + sudo ./temp.sh
2019-02-25T23:39:09.9383963Z sudo: ./temp.sh: command not found
2019-02-25T23:39:09.9385705Z + echo 1
2019-02-25T23:39:09.9387433Z 1
2019-02-25T23:39:09.9478312Z ##[section]Finishing: Enable WinRM
Посмотрите на вывод ниже, не знаете, почему он не может оправдать?
2019-02-26T03:47:57.4977014Z ==============================================================================
2019-02-26T03:47:57.4977119Z Task : Command Line
2019-02-26T03:47:57.4977157Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-02-26T03:47:57.4977195Z Version : 2.146.1
2019-02-26T03:47:57.4977413Z Author : Microsoft Corporation
2019-02-26T03:47:57.4977452Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2019-02-26T03:47:57.4977490Z ==============================================================================
2019-02-26T03:47:57.6351017Z Generating script.
2019-02-26T03:47:57.6400544Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/d66aeba8-bdab-42b1-8988-cb139d4169a9.sh
2019-02-26T03:47:57.6466344Z /home/vsts/work/r1/a
2019-02-26T03:47:57.6466863Z $
2019-02-26T03:47:57.6474398Z + pwd
2019-02-26T03:47:57.6475184Z + cd '/home/vsts/work/r1/a/_Terraform Build Phase/drop/terraform/scripts/'
2019-02-26T03:47:57.6475966Z + echo '$'
2019-02-26T03:47:57.6476271Z + ls
2019-02-26T03:47:57.6476447Z azure_rm.py
2019-02-26T03:47:57.6476490Z InstallWinRM.sh
2019-02-26T03:47:57.6476558Z temp.sh
2019-02-26T03:47:57.6476708Z 0
2019-02-26T03:47:57.6476917Z + echo 0
2019-02-26T03:47:57.6476972Z + sudo ./temp.sh
2019-02-26T03:47:57.9981782Z sudo: ./temp.sh: command not found
2019-02-26T03:47:58.0025055Z + echo 1
2019-02-26T03:47:58.0025466Z 1
2019-02-26T03:47:58.0111749Z ##[section]Finishing: Enable WinRM
Я добавил двойные кавычки, но все еще не работает?