如果我的docker运行hello-world出于任何原因失败,我怎么能jenkins失败?

大家好我使用jenkins执行初始安装。 这是我的脚本:

# Setup installation repository yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum makecache fast # Install yum install docker-ce # Run systemctl start docker # Test docker run hello-world #Add user to the group usermod -aG docker root 

如果我的docker运行hello-world出于任何原因失败,我怎么能jenkins失败。 有人知道这个剧本吗? Iam从我的Jenkins主服务器的“Execute Shell”占位符运行shell脚本,它执行我的从节点上的所有事情。 这是一个好主意吗 ??