package ShipIt::Step; use strict; =head1 NAME ShipIt::Step - a unit of work to be done prior to a release =head1 OVERVIEW Each step is implemented as a ShipIt::Step subclass, implementing an 'init' and 'run' method. =cut sub new { my ($class, $conf) = @_; my $self = bless {}, $class; $self->init($conf); return $self; } =head1 METHODS =head2 init($conf) Given the provided L object, retrieve configuration keys your step know about (using $conf->value($key)), and set fields in $self (an empty hashref) for use later, in the 'run' method. You can't access the configuration later in the 'run' method, as the configuration is then locked down, already having been sanity checked for unknown or missing keys. =cut # should override, if step needs configuration sub init { my ($self, $conf) = @_; } =head2 run($state) Run your step. Return on success, die on failure. Use the provided L $state object to inquire about the state of the release thus far, as populated by previous steps. =cut # return if okay, die if problems. sub run { my ($self, $state) = @_; warn "Running NO-OP base class 'run' for step $self\n"; } =head1 SEE ALSO L - the ShipIt system itself L L L L L L L L =cut 1;