Skip to content

Instantly share code, notes, and snippets.

@jbouse
Created April 10, 2019 20:52
Show Gist options
  • Save jbouse/9a7044e5e71e71055fc682f68cdf7902 to your computer and use it in GitHub Desktop.
Save jbouse/9a7044e5e71e71055fc682f68cdf7902 to your computer and use it in GitHub Desktop.
stage('Reload') {
options {
retry(2)
}
steps {
sh "curl -fsSLO ${JENKINS_URL}jnlpJars/jenkins-cli.jar"
withCredentials([usernamePassword(credentialsId: 'jenkins-remoting', passwordVariable: 'JENKINS_API_TOKEN', usernameVariable: 'JENKINS_USER_ID')]) {
sh "java -jar jenkins-cli.jar -s ${JENKINS_URL} reload-jcasc-configuration"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment