taken from jenkinsci/jenkins