exec.azurerm.containerregistry.task

Azure Resource Manager (ARM) Container Registry Task Execution Module

New in version 3.0.0.

maintainer:

<devops@eitr.tech>

configuration:

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function or via acct in order to work properly.

Required provider parameters:

if using username and password:
  • subscription_id
  • username
  • password
if using a service principal:
  • subscription_id
  • tenant
  • client_id
  • secret

Optional provider parameters:

cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:

  • AZURE_PUBLIC_CLOUD (default)
  • AZURE_CHINA_CLOUD
  • AZURE_US_GOV_CLOUD
  • AZURE_GERMAN_CLOUD
idem_azurerm.exec.azurerm.containerregistry.task.create_or_update(hub, ctx, name, registry_name, resource_group, task_type, platform_os, platform_arch, platform_variant=None, context_path=None, context_access_token=None, task_file_path=None, image_names=None, is_push_enabled=None, no_cache=None, target=None, encoded_task_content=None, encoded_values_content=None, values_file_path=None, values_dict=None, agent_num_cores=None, status=None, trigger=None, timeout=None, credential_login_mode=None, credential_login_server=None, credential_username=None, credential_password=None, identity_principal_id=None, identity_tenant_id=None, identity_type=None, user_assigned_identities=None, tags=None, **kwargs)

New in version 3.0.0.

Creates a task for a container registry with the specified parameters.

Parameters:
  • name – The name of the webhook.
  • registry_name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.
  • task_type – The type of task to be scheduled. Must be ‘DockerBuildStep’, ‘EncodedTaskStep’, or ‘FileTaskStep’.
  • platform_os – The platform OS property against which the task has to happen. Accepts ‘Windows’ or ‘Linux’.
  • platform_arch – The platform architecture property against which the task has to happen. Accepts ‘amd64’, ‘x86’, or ‘arm’.
  • platform_variant – The platform CPU variant property against which the run has to happen. Accepts ‘v6’, ‘v7’, or ‘v8’.
  • context_path – (DockerBuildStep, EncodedTaskStep, FileTaskStep) The URL(absolute or relative) of the source context for the task step. The build context for the step of the task should be a well formed absolute URI or there should be only one source trigger for the task.
  • context_access_token – (DockerBuildStep, EncodedTaskStep, FileTaskStep) The token (git PAT or SAS token of storage account blob) associated with the context for a step.
  • task_file_path – (DockerBuildStep, FileTaskStep REQUIRED) The template/definition file path relative to the source.
  • image_names – (DockerBuildStep) A list of strings containing the fully qualified image names including the repository and tag.
  • is_push_enabled – (DockerBuildStep) The value of this property indicates whether the image built should be pushed to the registry or not. SDK default value: True.
  • no_cache – (DockerBuildStep) The value of this property indicates whether the image cache is enabled or not. SDK default value: False.
  • target – (DockerBuildStep) The name of the target build stage for the docker build.
  • encoded_task_content – (EncodedTaskStep REQUIRED) Base64 encoded value of the template/definition file content.
  • encoded_values_content – (EncodedTaskStep) Base64 encoded value of the parameters/values file content.
  • values_file_path – (FileTaskStep) The values/parameters file path relative to the source context.
  • values_dict – The collection of overridable values or arguments that can be passed when running a task. This is a list of dictionaries containing the following keys: ‘name’, ‘value’, and ‘is_secret’.
  • agent_num_cores – The CPU configuration in terms of number of cores required for the run.
  • trigger – The properties that describe all triggers for the task. This is a dictionary containing trigger information as described in the documentation for the Azure Python SDK
  • status – The current status of task. Possible values include: ‘Disabled’, ‘Enabled’.
  • timeout – Run timeout in seconds. Default value: 3600.
  • credential_login_mode – The authentication mode which determines the source registry login scope. The credentials for the source registry will be generated using the given scope. These credentials will be used to login to the source registry during the run. Possible values include: ‘None’, ‘Default’.
  • credential_login_server – Describes the registry login server (myregistry.azurecr.io) for accessing other custom registries.
  • credential_username – Username for accessing the registry defined in credential_login_server.
  • credential_password – Password for accessing the registry defined in credential_login_server.
  • identity_principal_id – The principal ID of resource identity.
  • identity_tenant_id – The tenant ID of resource.
  • identity_type – The identity type. Possible values include: ‘SystemAssigned’, ‘UserAssigned’.
  • user_assigned_identities – The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}
  • tags – The tags of the resource.

CLI Example:

azurerm.containerregistry.task.create_or_update taskname testrepo testgroup task_type=FileTaskStep
                                                platform_os=Linux platform_os=amd64 platform_variant=v7
                                                context_path="https://eitr.tech/some/path"
                                                task_file_path="src/task.sh"
idem_azurerm.exec.azurerm.containerregistry.task.delete(hub, ctx, name, registry_name, resource_group, **kwargs)

New in version 3.0.0.

Deletes a task from a container registry.

Parameters:
  • name – The name of the container registry task.
  • registry_name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.

CLI Example:

azurerm.containerregistry.task.delete taskname testrepo testgroup
idem_azurerm.exec.azurerm.containerregistry.task.get(hub, ctx, name, registry_name, resource_group, details=False, **kwargs)

New in version 3.0.0.

Gets the properties of the specified task.

Parameters:
  • name – The name of the container registry task.
  • registry_name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.
  • details – Boolean flag to enable return of extended information that includes all secrets.

CLI Example:

azurerm.containerregistry.task.get taskname testrepo testgroup
idem_azurerm.exec.azurerm.containerregistry.task.list_(hub, ctx, name, resource_group, **kwargs)

New in version 3.0.0.

Lists all the tasks for the specified container registry.

Parameters:
  • name – The name of the container registry.
  • resource_group – The name of the resource group to which the container registry belongs.

CLI Example:

azurerm.containerregistry.task.list testrepo testgroup