Skip to content

Commit

Permalink
[AppService] BREAKING CHANGE: az webapp deployment source config: Rem…
Browse files Browse the repository at this point in the history
…ove vsts-cd-manager (#18203)

* Remove vsts-cd-manager

* Rerun tests

* Remove vsts-cd-manager

* Rerun tests
  • Loading branch information
calvinsID authored Jul 2, 2021
1 parent 2c746c9 commit 8701d60
Show file tree
Hide file tree
Showing 16 changed files with 1,178 additions and 2,456 deletions.
1 change: 0 additions & 1 deletion azure-cli.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\custom.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\tests\latest\test_webapp_commands.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\tests\latest\test_webapp_commands_thru_mock.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\vsts_cd_provider.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\_appservice_utils.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\_client_factory.py" />
<Compile Include="command_modules\azure-cli-appservice\azure\cli\command_modules\appservice\_completers.py" />
Expand Down
1 change: 0 additions & 1 deletion azure-cli2017.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@
<Compile Include="azure-cli\azure\cli\command_modules\appservice\tests\__init__.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\tunnel.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\utils.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\vsts_cd_provider.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\_appservice_utils.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\_client_factory.py" />
<Compile Include="azure-cli\azure\cli\command_modules\appservice\_completers.py" />
Expand Down
32 changes: 1 addition & 31 deletions src/azure-cli/azure/cli/command_modules/appservice/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,38 +256,8 @@ def load_arguments(self, _):
c.argument('repo_url', options_list=['--repo-url', '-u'],
help='repository url to pull the latest source from, e.g. https://github.com/foo/foo-web')
c.argument('branch', help='the branch name of the repository')
c.argument('private_repo_username', arg_group='VSTS CD Provider',
help='Username for the private repository')
c.argument('private_repo_password', arg_group='VSTS CD Provider',
help='Password for the private repository')
c.argument('cd_app_type', arg_group='VSTS CD Provider',
help='Web application framework you used to develop your app. Default is AspNet.',
arg_type=get_enum_type(['AspNet', 'AspNetCore', 'NodeJS', 'PHP', 'Python']))
c.argument('app_working_dir', arg_group='VSTS CD Provider',
help='Working directory of the application. Default will be root of the repo')
c.argument('nodejs_task_runner', arg_group='VSTS CD Provider',
help='Task runner for nodejs. Default is None',
arg_type=get_enum_type(['None', 'Gulp', 'Grunt']))
c.argument('python_framework', arg_group='VSTS CD Provider',
help='Framework used for Python application. Default is Django',
arg_type=get_enum_type(['Bottle', 'Django', 'Flask']))
c.argument('python_version', arg_group='VSTS CD Provider',
help='Python version used for application. Default is Python 3.5.3 x86',
arg_type=get_enum_type(['Python 2.7.12 x64', 'Python 2.7.12 x86', 'Python 2.7.13 x64',
'Python 2.7.13 x86', 'Python 3.5.3 x64', 'Python 3.5.3 x86',
'Python 3.6.0 x64', 'Python 3.6.0 x86', 'Python 3.6.2 x64',
'Python 3.6.1 x86']))
c.argument('cd_project_url', arg_group='VSTS CD Provider',
help='URL of the Visual Studio Team Services (VSTS) project to use for continuous delivery. URL should be in format `https://<accountname>.visualstudio.com/<projectname>`')
c.argument('cd_account_create', arg_group='VSTS CD Provider',
help="To create a new Visual Studio Team Services (VSTS) account if it doesn't exist already",
action='store_true')
c.argument('test', arg_group='VSTS CD Provider',
help='Name of the web app to be used for load testing. If web app is not available, it will be created. Default: Disable')
c.argument('slot_swap', arg_group='VSTS CD Provider',
help='Name of the slot to be used for deployment and later promote to production. If slot is not available, it will be created. Default: Not configured')
c.argument('repository_type', help='repository type',
arg_type=get_enum_type(['git', 'mercurial', 'vsts', 'github', 'externalgit', 'localgit']))
arg_type=get_enum_type(['git', 'mercurial', 'github', 'externalgit', 'localgit']))
c.argument('git_token', help='Git access token required for auto sync')
c.argument('github_action', options_list=['--github-action'], help='If using github action, default to False')
with self.argument_context(scope + ' identity') as c:
Expand Down
36 changes: 1 addition & 35 deletions src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

from .tunnel import TunnelServer

from .vsts_cd_provider import VstsContinuousDeliveryProvider
from ._params import AUTH_TYPES, MULTI_CONTAINER_TYPES
from ._client_factory import web_client_factory, ex_handler_factory, providers_client_factory
from ._appservice_utils import _generic_site_operation, _generic_settings_operation
Expand Down Expand Up @@ -1563,43 +1562,10 @@ def update_slot_configuration_from_source(cmd, client, resource_group_name, weba


def config_source_control(cmd, resource_group_name, name, repo_url, repository_type='git', branch=None, # pylint: disable=too-many-locals
manual_integration=None, git_token=None, slot=None, cd_app_type=None,
app_working_dir=None, nodejs_task_runner=None, python_framework=None,
python_version=None, cd_account_create=None, cd_project_url=None, test=None,
slot_swap=None, private_repo_username=None, private_repo_password=None, github_action=None):
manual_integration=None, git_token=None, slot=None, github_action=None):
client = web_client_factory(cmd.cli_ctx)
location = _get_location_from_webapp(client, resource_group_name, name)

if cd_project_url:
# Add default values
cd_app_type = 'AspNet' if cd_app_type is None else cd_app_type
python_framework = 'Django' if python_framework is None else python_framework
python_version = 'Python 3.5.3 x86' if python_version is None else python_version

webapp_list = None if test is None else list_webapp(resource_group_name)
vsts_provider = VstsContinuousDeliveryProvider()
cd_app_type_details = {
'cd_app_type': cd_app_type,
'app_working_dir': app_working_dir,
'nodejs_task_runner': nodejs_task_runner,
'python_framework': python_framework,
'python_version': python_version
}
try:
status = vsts_provider.setup_continuous_delivery(cmd.cli_ctx, resource_group_name, name, repo_url,
branch, git_token, slot_swap, cd_app_type_details,
cd_project_url, cd_account_create, location, test,
private_repo_username, private_repo_password, webapp_list)
except RuntimeError as ex:
raise CLIError(ex)
logger.warning(status.status_message)
return status
non_vsts_params = [cd_app_type, app_working_dir, nodejs_task_runner, python_framework,
python_version, cd_account_create, test, slot_swap]
if any(non_vsts_params):
raise CLIError('Following parameters are of no use when cd_project_url is None: ' +
'cd_app_type, app_working_dir, nodejs_task_runner, python_framework,' +
'python_version, cd_account_create, test, slot_swap')
from azure.mgmt.web.models import SiteSourceControl, SourceControl
if git_token:
sc = SourceControl(location=location, source_control_name='GitHub', token=git_token)
Expand Down
Loading

0 comments on commit 8701d60

Please sign in to comment.