forked from jenkinsci/jenkins.rb
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
class <%= name.capitalize %>Listener | ||
include Jenkins::Slaves::ComputerListener | ||
|
||
# Called before a {ComputerLauncher} is asked to launch a connection with {Computer}. | ||
# | ||
# This enables you to do some configurable checks to see if we | ||
# want to bring this slave online or if there are considerations | ||
# that would keep us from doing so. | ||
# | ||
# Calling Computer#abort would let you veto the launch operation. Other thrown exceptions | ||
# will also have the same effect | ||
# | ||
# @param [Jenkins::Model::Computer] computer the computer about to be launched | ||
# @param [Jenkins::Model::Listener] listener the listener connected to the slave console log. | ||
def prelaunch(computer, listener) | ||
end | ||
|
||
# Called when a slave attempted to connect via {ComputerLauncher} but failed. | ||
# | ||
# @param [Jenkins::Model::Computer] computer the computer that was trying to launch | ||
# @param [Jenkins::Model::Listener] listener the listener connected to the slave console log | ||
def launchfailed(computer, listener) | ||
end | ||
|
||
# Called before a {Computer} is marked online. | ||
# | ||
# This enables you to do some work on all the slaves | ||
# as they get connected. Unlike {#online}, | ||
# a failure to carry out this function normally will prevent | ||
# a computer from marked as online. | ||
# | ||
# @param [Jenkins::Remote::Channel] channel the channel object to talk to the slave. | ||
# @param [Jenkins::FilePath] root the directory where this slave stores files. | ||
# @param [Jenkins::Model::Listener] listener connected to the launch log of the computer. | ||
# @see {#online} | ||
def preonline(computer, channel, root, listener) | ||
end | ||
|
||
# Called right after a {Computer} comes online. | ||
# | ||
# This enables you to do some work on all the slaves | ||
# as they get connected. | ||
# | ||
# | ||
# @param [Jenkins::Model::Computer] computer the computer that just came online | ||
# @param [Jenkins::Model::Listener] listener connected to the launch log of the computer. | ||
# @see {#preonline} | ||
# | ||
def online(computer, listener) | ||
end | ||
|
||
# Called right after a {@link Computer} went offline. | ||
# | ||
# @param [Jenkins::Model::Computer] computer the computer that just went offline | ||
def offline(computer) | ||
end | ||
|
||
# Called when configuration of the node was changed, a node is added/removed, etc. | ||
def configured() | ||
end | ||
end |