Class: CircleCI::Parallel::Configuration::ConfigurationCollectionProxy

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

Overview

A convenient proxy to modify both master node and slave node configuration at once.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*configurations) ⇒ ConfigurationCollectionProxy

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 ConfigurationCollectionProxy.



12
13
14
# File 'lib/circleci/parallel/configuration/configuration_collection_proxy.rb', line 12

def initialize(*configurations)
  @configurations = configurations
end

Instance Attribute Details

#configurationsObject (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.



9
10
11
# File 'lib/circleci/parallel/configuration/configuration_collection_proxy.rb', line 9

def configurations
  @configurations
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 every 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:



56
57
58
59
60
# File 'lib/circleci/parallel/configuration/configuration_collection_proxy.rb', line 56

def after_sync(chdir: true, &block)
  configurations.each do |configuration|
    configuration.after_sync(chdir: chdir, &block)
  end
end

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

This method returns an undefined value.

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

Examples:

CircleCI::Parallel.configure do |config|
  config.on_every_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:



33
34
35
36
37
# File 'lib/circleci/parallel/configuration/configuration_collection_proxy.rb', line 33

def before_sync(chdir: true, &block)
  configurations.each do |configuration|
    configuration.before_sync(chdir: chdir, &block)
  end
end