On 11/10/2017 08:13 AM, john.peterson wrote:
> We have been using PostBuild Script to execute the following command on
> the remote machine (as Build Steps > Execute Windows Batch Command):
> 
> Shutdown  -s  -t:0     (I think I have that correct)
> 
> We have to do this to make sure that NO MATTER WHAT our remote PC (VM)
> is shutdown, otherwise, occasionally, a queued script will begin
> execution on the already open VM.
> 
> How can we do this and NOT use the PostBuild Script plugin?
> 
> We were running 1.58 in the past and are just now updating to 2.87

Greetings John,

For us, we keep a copy of the plugin around and upload it to new Jenkins
instances that we stand up as we have some very specific uses of it that
none of the other plugins handle and our jobs are all under code review
via Jenkins Job Builder so we know that no malicious extras are showing
up in the post script.

For your use case though, I might suggest the following additional plugin:

https://wiki.jenkins.io/display/JENKINS/Single+Use+Slave+Plugin

That will allow you to make your instances single use, but you do still
need to have a way of cleaning up any now offlined systems.

If you're doing dynamic build instances via JClouds (or the OpenStack
plugin), each job has the ability to define a build node be single-use.
The plugin will properly reap out instances that have been used once
when doing this.

>From personal experience, if you're using the EC2 plugin, this doesn't
work, I've got a cron hack that I've got in place that makes use of the
Single Use Slave Plugin and some custom groovy and awscli to get similar
functionality as the the JClouds (which I would be using for EC2 but
it's failing to handle a configuration properly) and OpenStack plugins.

-Andy-

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/72e65658-5d53-ffe3-051b-c5bf180217cf%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to