Class: CircleCI::Parallel::Configuration::SlaveNodeConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/circleci/parallel/configuration/slave_node_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSlaveNodeConfiguration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SlaveNodeConfiguration.



11
12
13
# File 'lib/circleci/parallel/configuration/slave_node_configuration.rb', line 11

def initialize
  @before_sync_hook = @after_sync_hook = Hook.new
end

Instance Attribute Details

#after_sync_hookObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/circleci/parallel/configuration/slave_node_configuration.rb', line 8

def after_sync_hook
  @after_sync_hook
end

#before_sync_hookObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/circleci/parallel/configuration/slave_node_configuration.rb', line 8

def before_sync_hook
  @before_sync_hook
end

Instance Method Details

#after_sync(chdir: true) {|local_data_dir| ... }

This method returns an undefined value.

Defines a callback that will be invoked on each slave node after syncing all nodes.

Examples:

CircleCI::Parallel.configure do |config|
  config.on_each_slave_node.after_sync do
    clean_some_intermediate_data
  end
end

Parameters:

  • chdir (Boolean) (defaults to: true)

    whether the callback should be invoked while changing the current working directory to the local data directory.

Yield Parameters:

  • local_data_dir (String)

    the path to the local data directory

See Also:



53
54
55
# 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) {|local_data_dir| ... }

This method returns an undefined value.

Defines a callback that will be invoked on each slave node before syncing all nodes.

Examples:

CircleCI::Parallel.configure do |config|
  config.on_each_slave_node.before_sync do
    File.write('data.json', JSON.generate(some_data))
  end
end

Parameters:

  • chdir (Boolean) (defaults to: true)

    whether the callback should be invoked while changing the current working directory to the local data directory.

Yield Parameters:

  • local_data_dir (String)

    the path to the local data directory

See Also:



32
33
34
# 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