In my release pipeline, I am trying to call below command.
echo 'Bring down all dockers'
cd /usr/src/project
sudo docker-compose down
echo 'Setting the ownership of /usr/src/project to $(serviceuser)'
sudo chown -R $(serviceuser) /usr/src/project
sudo chmod -R 777 /usr/src/project
Everything is getting executed fine on the remote machine. But, it reports weird responses back to the agent. as below
2020-05-31T04:16:18.7284676Z Bring down all dockers
2020-05-31T04:16:18.7285634Z
2020-05-31T04:16:19.3872061Z ##[error]Stopping gateway_1 ...
Stopping web_1 ...
Stopping service_1 ...
Stopping service_2 ...
2020-05-31T04:16:19.8215312Z ##[error][13A[2K
Stopping gateway_1 ... [32mdone[0m
[13B
2020-05-31T04:16:21.0904515Z ##[error][5A[2K
Stopping service_1 ... [32mdone[0m
[5B
2020-05-31T04:16:21.8607668Z ##[error][7A[2K
Stopping service_2 ... [32mdone[0m
[7B
2020-05-31T04:16:22.9615503Z ##[error][4A[2K
Removing web_1 ... [32mdone[0m
[4B
2020-05-31T04:16:22.9665540Z ##[error][5A[2K
Removing service_1 ... [32mdone[0m
[5B
2020-05-31T04:16:22.9682527Z ##[error][11A[2K
Removing service_2 ... [32mdone[0m
[11B
2020-05-31T04:16:23.1683671Z Delete everything under /usr/src/project/
2020-05-31T04:16:23.1684185Z
2020-05-31T04:16:23.1993484Z Creating new folder /usr/src/project/
2020-05-31T04:16:23.1994279Z
2020-05-31T04:16:23.2195927Z Setting the ownership of /usr/src/project to builduser
2020-05-31T04:16:23.2196728Z
2020-05-31T04:16:23.2584025Z ##[error]Command failed with errors on remote machine.
So, this makes the job showing as failed. Any suggestion would be helpful.
Build Machine: RHEL 8 Service VM: RHEL 8 Azure Agenet: Self Hosted
Thanks!
This is because docker writes those messages to stderr
instead of stdout
. In Azure DevOps pipeline in SSH task there is option Fail on STDERR which is checked by default.
You can try to uncheck this option to see if it works.
You can refer to this ticket with similar issue .