I have the following sh command in my Jenkinsfile which does not work because it tries to execute the last "DATA" as a command. If I move last "DATA" to the beginning of the line it works but is not as beautiful as I want. Is there a way to the indention in this case?
sh """
sshpass -p 'password' ssh -o StrictHostKeyChecking=no appsadm@$backup_registry <<DATA
sudo /etc/init.d/docker stop || true
sudo yum remove -y docker-engine.x86_64
sudo rm -fr /var/lib/docker /var/log/docker
sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm || true
sudo yum update -y
sudo yum -y install docker-io
sudo sed -i 's#other_args=.*#other_args="--insecure-registry $official_registry:5000"#g' /etc/sysconfig/docker
sudo /etc/init.d/docker start
DATA
"""