File: //lib/python3/dist-packages/awscli/customizations/ecs/__pycache__/deploy.cpython-310.pyc
o
.&�a�D � @ s� d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZ d dl m
Z
d dlmZm
Z
d dlmZ dZdZd ZG d
d� de�ZG dd
� d
�ZG dd� d�ZG dd� d�ZdS )� N)�compat�config)�ClientError)�compat_open)�
exceptions�filehelpers)�BasicCommand�
� ih c @ s� e Zd ZdZdZdddd�dddd�d d
dd�ddd
d�ddd
d�ddd
d�gZdZdZdZdZ dd� Z
dd� Zdd� Zdd� Z
dd� Zd d!� Zd"d#� Zd$S )%� ECSDeploy�deploya Deploys a new task definition to the specified ECS service. Only services that use CodeDeploy for deployments are supported. This command will register a new task definition, update the CodeDeploy appspec with the new task definition revision, create a CodeDeploy deployment, and wait for the deployment to successfully complete. This command will exit with a return code of 255 if the deployment does not succeed within 30 minutes by default or up to 10 minutes more than your deployment group's configured wait time (max of 6 hours).�servicezJThe short name or full Amazon Resource Name (ARN) of the service to updateT)�name� help_text�requiredztask-definitionz�The file path where your task definition file is located. The format of the file must be the same as the JSON output of: <codeblock>aws ecs register-task-definition --generate-cli-skeleton</codeblock>�codedeploy-appspeca The file path where your AWS CodeDeploy appspec file is located. The appspec file may be in JSON or YAML format. The <code>TaskDefinition</code> property will be updated within the appspec with the newly registered task definition ARN, overwriting any placeholder values in the file.�clusterz�The short name or full Amazon Resource Name (ARN) of the cluster that your service is running within. If you do not specify a cluster, the "default" cluster is assumed.Fzcodedeploy-applicationz�The name of the AWS CodeDeploy application to use for the deployment. The specified application must use the 'ECS' compute platform. If you do not specify an application, the application name <code>AppECS-[CLUSTER_NAME]-[SERVICE_NAME]</code> is assumed.zcodedeploy-deployment-groupa* The name of the AWS CodeDeploy deployment group to use for the deployment. The specified deployment group must be associated with the specified ECS service and cluster. If you do not specify a deployment group, the deployment group name <code>DgpECS-[CLUSTER_NAME]-[SERVICE_NAME]</code> is assumed.z6Successfully registered new ECS task definition {arn}
z%Successfully created deployment {id}
z8Successfully deployed {task_def} to service '{service}'
zcustomization/ecs-deployc C s� | � |j|j�\}}t| j||| j�}| �||�| _| jjd|j |j
tj| jd�d�}| �
|� | j�� | _| �||�| _| �||� d S )N�
codedeploy��user_agent_extra)�region_name�verifyr )�_load_file_args�task_definition�codedeploy_appspec� ECSClient�_session�USER_AGENT_EXTRA�_get_resource_names� resources�
create_client�region�
verify_sslr �Config�_validate_code_deploy_resources�
_cd_validator�get_deployment_wait_time� wait_time�_register_task_def�task_def_arn�_create_and_wait_for_deployment)�self�parsed_args�parsed_globals�register_task_def_kwargs�appspec_obj�ecs_client_wrapper�codedeploy_client� r2 �B/usr/lib/python3/dist-packages/awscli/customizations/ecs/deploy.py� _run_mainr s, �����
�zECSDeploy._run_mainc C s� t ||�}|�| j� |�| jd | jd �}tj�| jj |d�� |�
|| j� | jd }tj�| jj | j|d�� tj�
� d S )N�app_name�deployment_group_name)�idr
)�task_defr
)�CodeDeployer�update_task_def_arnr) �create_deploymentr �sys�stdout�write�MSG_CREATED_DEPLOYMENT�format�wait_for_deploy_successr'