runway.module package

Runway module module.

class runway.module.ModuleOptions[source]

Bases: collections.abc.MutableMapping

Base class for Runway module options.

static merge_nested_env_dicts(data, env_name=None)[source]

Merge nested env dicts.

Parameters
  • data (Any) – Data to try to merge.

  • env_name (Optional[str]) – Current environment.

Returns

Any

classmethod parse(context, **kwargs)[source]

Parse module options definition to extract usable options.

Parameters

context (Context) – Runway context object.

class runway.module.RunwayModule(context, path, options=None)[source]

Bases: object

Base class for Runway modules.

Instantiate class.

Parameters
  • context (Context) – Runway context object.

  • path (Union[str, Path]) – Path to the module.

  • options (Dict[str, Dict[str, Any]]) – Everything in the module definition merged with applicable values from the deployment definition.

deploy()[source]

Implement dummy method (set in consuming classes).

destroy()[source]

Implement dummy method (set in consuming classes).

plan()[source]

Implement dummy method (set in consuming classes).

class runway.module.RunwayModuleNpm(context, path, options=None)[source]

Bases: runway.module.RunwayModule

Base class for Runway modules that use npm.

Instantiate class.

Parameters
  • context (Context) – Runway context object.

  • path (Union[str, Path]) – Path to the module.

  • options (Dict[str, Dict[str, Any]]) – Everything in the module definition merged with applicable values from the deployment definition.

check_for_npm()[source]

Ensure npm is installed and in the current path.

log_npm_command(command)[source]

Log an npm command that is going to be run.

Parameters

command (List[str]) – List that will be passed into a subprocess.

npm_install()[source]

Run npm install.

package_json_missing()[source]

Check for the existence for a package.json file in the module.

Returns

True if the file was not found.

Return type

bool

runway.module.format_npm_command_for_logging(command)[source]

Convert npm command list to string for display to user.

runway.module.generate_node_command(command, command_opts, path, logger=<RunwayLogger runway.module (WARNING)>)[source]

Return node bin command list for subprocess execution.

runway.module.run_module_command(cmd_list, env_vars, exit_on_error=True, logger=<RunwayLogger runway.module (WARNING)>)[source]

Shell out to provisioner command.

runway.module.run_npm_install(path, options, context, logger=<RunwayLogger runway.module (WARNING)>)[source]

Run npm install/ci.

runway.module.use_npm_ci(path)[source]

Return true if npm ci should be used in lieu of npm install.

runway.module.warn_on_boto_env_vars(env_vars)[source]

Inform user if boto-specific environment variables are in use.