Hi We make use of:
command: ["java", "-jar", "/var/jenkins_home/war/WEB-INF/jenkins-cli.jar", "-s", "http://127.0.0.1:8080/scheduler", "safe-shutdown"] To shutdown a Jenkins server. According to the documentation https://support.cloudbees.com/hc/en-us/articles/216118748-How-to-Start-Stop-or-Restart-your-Instance- and https://stackoverflow.com/questions/10238604/how-to-shutdown-my-jenkins-safely/13527164 this should be fine to wait for job completion before shutdown. But the command for terminates the server immediately and restarts the Job after. Our job is a regular flow/pipeline definition: <?xml version='1.1' encoding='UTF-8'?> <flow-definition plugin="[email protected]"> <actions/> <description></description> <keepDependencies>false</keepDependencies> <properties> <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> <triggers> <hudson.triggers.TimerTrigger> <spec>0 3 * * *</spec> </hudson.triggers.TimerTrigger> </triggers> </org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> </properties> <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]"> <script> node { stage('Run') { sh ''' #!/usr/bin/env bash exec kubectl run ... ... ''' } } </script> <sandbox>true</sandbox> </definition> <triggers/> <disabled>false</disabled> </flow-definition> It shows log entries like: Ready to run at Mon Jun 24 11:46:22 GMT 2019 Resuming build at Mon Jun 24 11:50:56 GMT 2019 after Jenkins restart Waiting to resume part of demo-import #71: Finished waiting In this case it runs some shell scripts. The documentation does not mention the use of termination signals or anything that would maybe stop the job? Thank you, Regards Remo -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c3fece50-f8b2-41e1-a2f3-9f5a7ce1bb38%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
