Skip to content

Instantly share code, notes, and snippets.

@timja
Created February 1, 2019 16:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timja/0838563e8260bea5dcfddc2f687cc3a3 to your computer and use it in GitHub Desktop.
Save timja/0838563e8260bea5dcfddc2f687cc3a3 to your computer and use it in GitHub Desktop.
Reload JCASC
stage("Reload") {
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"
}
archiveArtifacts artifacts: 'dist/**', fingerprint: true, onlyIfSuccessful: true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment