class CircleCI::Parallel::Configuration::SlaveNodeConfiguration
Attributes
after_sync_hook[R]
@api private
before_sync_hook[R]
@api private
Public Class Methods
new()
click to toggle source
@api private
# File lib/circleci/parallel/configuration/slave_node_configuration.rb, line 11 def initialize @before_sync_hook = @after_sync_hook = Hook.new end
Public Instance Methods
after_sync(chdir: true, &block)
click to toggle source
Defines a callback that will be invoked on each slave node after syncing all nodes.
@param chdir [Boolean] whether the callback should be invoked while changing the current
working directory to the local data directory.
@yieldparam local_data_dir [String] the path to the local data directory
@return [void]
@example
CircleCI::Parallel.configure do |config| config.on_each_slave_node.after_sync do clean_some_intermediate_data end end
@see CircleCI::Parallel.local_data_dir
# File lib/circleci/parallel/configuration/slave_node_configuration.rb, line 53 def after_sync(chdir: true, &block) @after_sync_hook = Hook.new(block, chdir) end
before_sync(chdir: true, &block)
click to toggle source
Defines a callback that will be invoked on each slave node before syncing all nodes.
@param chdir [Boolean] whether the callback should be invoked while changing the current
working directory to the local data directory.
@yieldparam local_data_dir [String] the path to the local data directory
@return [void]
@example
CircleCI::Parallel.configure do |config| config.on_each_slave_node.before_sync do File.write('data.json', JSON.generate(some_data)) end end
@see CircleCI::Parallel.local_data_dir
# File lib/circleci/parallel/configuration/slave_node_configuration.rb, line 32 def before_sync(chdir: true, &block) @before_sync_hook = Hook.new(block, chdir) end