cumulusci.tasks package

Submodules

Tasks for running a command in a subprocess

Command - run a command with optional environment variables SalesforceCommand - run a command with credentials passed SalesforceBrowserTest - a task designed to wrap browser testing that could run locally or remotely

class cumulusci.tasks.command.Command(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

Execute a shell command in a subprocess

task_docs = '\n **Example Command-line Usage::** cci task run command -o command "echo \'Hello command task!\'"\n\n **Example Task to Run Command::**\n hello_world:\n description: Says hello world\n class_path: cumulusci.tasks.command.Command\n options:\n command: echo \'Hello World!\'\n '
task_options = {'command': {'description': 'The command to execute', 'required': True}, 'dir': {'description': 'If provided, the directory where the command should be run from.'}, 'env': {'description': 'Environment variables to set for command. Must be flat dict, either as python dict from YAML or as JSON string.'}, 'interactive': {'description': 'If True, the command will use stderr, stdout, and stdin of the main process.Defaults to False.'}, 'pass_env': {'description': 'If False, the current environment variables will not be passed to the child process. Defaults to True', 'required': True}}
class cumulusci.tasks.command.SalesforceBrowserTest(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.command.SalesforceCommand

Execute a Browser Test command locally or on SauceLabs

task_options = {'command': {'description': 'The command to execute', 'required': True}, 'dir': {'description': 'If provided, the directory where the command should be run from.'}, 'env': {'description': 'Environment variables to set for command. Must be flat dict, either as python dict from YAML or as JSON string.'}, 'extra': {'description': 'If provided, will be appended to the end of the command. Use to pass extra args to the command.', 'required': False}, 'interactive': {'description': 'If True, the command will use stderr, stdout, and stdin of the main process.Defaults to False.'}, 'pass_env': {'description': 'If False, the current environment variables will not be passed to the child process. Defaults to True', 'required': True}, 'use_saucelabs': {'description': 'If True, use SauceLabs to run the tests. The SauceLabs credentials will be fetched from the saucelabs service in the keychain and passed as environment variables to the command. Defaults to False to run tests in the local browser.', 'required': True}}
class cumulusci.tasks.command.SalesforceCommand(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.command.Command

Execute a Command with SF credentials provided on the environment.

Provides:
  • SF_INSTANCE_URL
  • SF_ACCESS_TOKEN
salesforce_task = True
class cumulusci.tasks.connectedapp.CreateConnectedApp(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.sfdx.SFDXBaseTask

client_id_length = 85
client_secret_length = 32
deploy_wait = 5
task_options = {'connect': {'description': 'If True, the created connected app will be stored as the CumulusCI connected_app service in the keychain.', 'required': False}, 'email': {'description': 'The email address to associate with the connected app. Defaults to email address from the github service if configured.'}, 'label': {'description': 'The label for the connected app. Must contain only alphanumeric and underscores', 'required': True}, 'overwrite': {'description': 'If True, any existing connected_app service in the CumulusCI keychain will be overwritten. Has no effect if the connect option is False.', 'required': False}, 'username': {'description': 'Create the connected app in a different org. Defaults to the defaultdevhubusername configured in sfdx.', 'required': False}}
class cumulusci.tasks.datadictionary.GenerateDataDictionary(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.github.base.BaseGithubTask

task_docs = '\n Generate a data dictionary for the project by walking all GitHub releases.\n The data dictionary is output as two CSV files.\n One, in `object_path`, includes the Object Name, Object Label, and Version Introduced,\n with one row per packaged object.\n The other, in `field_path`, includes Object Name, Field Name, Field Label, Field Type,\n Picklist Values (if any), Version Introduced.\n Both MDAPI and SFDX format releases are supported. However, only force-app/main/default\n is processed for SFDX projects.\n '
task_options = {'field_path': {'description': 'Path to a CSV file to contain an field-level data dictionary.'}, 'object_path': {'description': 'Path to a CSV file to contain an sObject-level data dictionary.'}, 'release_prefix': {'description': 'The tag prefix used for releases.', 'required': True}}
class cumulusci.tasks.metadeploy.BaseMetaDeployTask(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

Base class for tasks that talk to MetaDeploy’s API.

class cumulusci.tasks.metadeploy.Publish(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.metadeploy.BaseMetaDeployTask

Publishes installation plans to MetaDeploy.

task_options = {'commit': {'description': 'Commit hash to publish'}, 'dry_run': {'description': 'If True, print steps without publishing.', 'required': False}, 'plan': {'description': 'Name of the plan(s) to publish. This refers to the `plans` section of cumulusci.yml. By default, all plans will be published.', 'required': False}, 'publish': {'description': 'If True, set is_listed to True on the version. Default: False', 'required': False}, 'tag': {'description': 'Name of the git tag to publish'}}
class cumulusci.tasks.metaxml.MetaXmlBaseTask(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

class cumulusci.tasks.metaxml.UpdateApi(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.metaxml.MetaXmlBaseTask

task_options = {'dir': {'description': 'Base directory to search for ``*-meta.xml`` files'}, 'version': {'description': 'API version number e.g. 37.0', 'required': True}}
class cumulusci.tasks.metaxml.UpdateDependencies(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.metaxml.MetaXmlBaseTask

task_options = {'dir': {'description': 'Base directory to search for ``*-meta.xml`` files'}}

Wrapper tasks for the SFDX CLI

TODO: Instead of everyone overriding random attrs, especially as future users subclass these tasks, we should expose an api for the string format function. i.e. make it easy for subclasses to add to the string inherited from the base.

Actually do this in Command. have it expose command segments.

Then here in SFDX we will add an additional metalayer for how the CLI formats args opts commands etc.

class cumulusci.tasks.sfdx.SFDXBaseTask(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.command.Command

Call the sfdx cli with params and no org

task_options = {'command': {'description': 'The full command to run with the sfdx cli.', 'required': True}, 'extra': {'description': 'Append additional options to the command'}}
class cumulusci.tasks.sfdx.SFDXJsonTask(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.sfdx.SFDXOrgTask

command = 'force:mdapi:deploy --json'
class cumulusci.tasks.sfdx.SFDXOrgTask(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.sfdx.SFDXBaseTask

Call the sfdx cli with a workspace username

salesforce_task = True
class cumulusci.tasks.util.CopyFile(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

task_options = {'dest': {'description': 'The destination path where the src file should be copied', 'required': True}, 'src': {'description': 'The path to the source file to copy', 'required': True}}
class cumulusci.tasks.util.Delete(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

name = 'Delete'
task_options = {'chdir': {'description': 'Change directories before deleting path(s). This is useful if you have a common list of relative paths to delete that you want to call against different directories.'}, 'path': {'description': 'The path to delete. If path is a directory, recursively deletes the directory: BE CAREFUL!!! If path is a list, all paths will be deleted', 'required': True}}
class cumulusci.tasks.util.DownloadZip(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

name = 'Download'
task_options = {'dir': {'description': 'The directory where the zip should be extracted', 'required': True}, 'subfolder': {'description': 'The subfolder of the target zip to extract. Defaults to extracting the root of the zip file to the destination.'}, 'url': {'description': 'The url of the zip file to download', 'required': True}}
class cumulusci.tasks.util.FindReplace(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

task_options = {'file_pattern': {'description': 'A UNIX like filename pattern used for matching filenames, or a list of them. See python fnmatch docs for syntax. If passed via command line, use a comma separated string. Defaults to *'}, 'find': {'description': 'The string to search for', 'required': True}, 'max': {'description': 'The max number of matches to replace. Defaults to replacing all matches.'}, 'path': {'description': 'The path to recursively search', 'required': True}, 'replace': {'description': 'The string to replace matches with. Defaults to an empty string', 'required': True}}
class cumulusci.tasks.util.FindReplaceRegex(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.tasks.util.FindReplace

task_options = {'file_pattern': {'description': 'A UNIX like filename pattern used for matching filenames, or a list of them. See python fnmatch docs for syntax. If passed via command line, use a comma separated string. Defaults to *'}, 'find': {'description': 'The string to search for', 'required': True}, 'path': {'description': 'The path to recursively search', 'required': True}, 'replace': {'description': 'The string to replace matches with. Defaults to an empty string', 'required': True}}
class cumulusci.tasks.util.ListMetadataTypes(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

name = 'ListMetadataTypes'
task_options = {'package_xml': {'description': 'The project package.xml file. Defaults to <project_root>/src/package.xml'}}
class cumulusci.tasks.util.LogLine(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

task_options = {'format_vars': {'description': 'A Dict of format vars', 'required': False}, 'level': {'description': 'The logger level to use', 'required': True}, 'line': {'description': 'A formatstring like line to log', 'required': True}}
class cumulusci.tasks.util.PassOptionAsResult(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

task_options = {'result': {'description': 'The result for the task', 'required': True}}
class cumulusci.tasks.util.PassOptionAsReturnValue(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

task_options = {'key': {'description': 'The return value key to use.', 'required': True}, 'value': {'description': 'The value to set.', 'required': True}}
class cumulusci.tasks.util.Sleep(project_config, task_config, org_config=None, flow=None, name=None, stepnum=None, **kwargs)[source]

Bases: cumulusci.core.tasks.BaseTask

name = 'Sleep'
task_options = {'seconds': {'description': 'The number of seconds to sleep', 'required': True}}

Module contents