Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/customizations/codedeploy/codedeploy.py
1567 views
1
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
14
from awscli.customizations import utils
15
from awscli.customizations.codedeploy.locationargs import \
16
modify_revision_arguments
17
from awscli.customizations.codedeploy.push import Push
18
from awscli.customizations.codedeploy.register import Register
19
from awscli.customizations.codedeploy.deregister import Deregister
20
from awscli.customizations.codedeploy.install import Install
21
from awscli.customizations.codedeploy.uninstall import Uninstall
22
23
24
def initialize(cli):
25
"""
26
The entry point for CodeDeploy high level commands.
27
"""
28
cli.register(
29
'building-command-table.main',
30
change_name
31
)
32
cli.register(
33
'building-command-table.deploy',
34
inject_commands
35
)
36
cli.register(
37
'building-argument-table.deploy.get-application-revision',
38
modify_revision_arguments
39
)
40
cli.register(
41
'building-argument-table.deploy.register-application-revision',
42
modify_revision_arguments
43
)
44
cli.register(
45
'building-argument-table.deploy.create-deployment',
46
modify_revision_arguments
47
)
48
49
50
def change_name(command_table, session, **kwargs):
51
"""
52
Change all existing 'aws codedeploy' commands to 'aws deploy' commands.
53
"""
54
utils.rename_command(command_table, 'codedeploy', 'deploy')
55
56
57
def inject_commands(command_table, session, **kwargs):
58
"""
59
Inject custom 'aws deploy' commands.
60
"""
61
command_table['push'] = Push(session)
62
command_table['register'] = Register(session)
63
command_table['deregister'] = Deregister(session)
64
command_table['install'] = Install(session)
65
command_table['uninstall'] = Uninstall(session)
66
67