This commit is contained in:
Ishita Mehta 2020-01-28 16:34:03 +05:30
Родитель d6bbfea13d
Коммит 8187922d4f
20 изменённых файлов: 49 добавлений и 49 удалений

Просмотреть файл

@ -12,7 +12,7 @@ pr:
jobs:
- job: 'Build_Publish_AKS_Deploy_CLI_Extension'
- job: 'Build_Publish_Deploy_To_Azure_CLI_Extension'
pool:
vmImage: 'Ubuntu-16.04'
@ -24,7 +24,7 @@ jobs:
- template: templates/setup-ci-machine.yml
- template: templates/build-publish-aks-deploy-cli-extension.yml
- template: templates/build-publish-deploy-to-azure-cli-extension.yml
- job: 'Build_Publish_Azure_CLI_Test_SDK'
@ -58,7 +58,7 @@ jobs:
- template: templates/setup-ci-machine.yml
- template: templates/download-install-local-aks-deploy-cli-extension-with-pip.yml
- template: templates/download-install-local-deploy-to-azure-cli-extension-with-pip.yml
- task: PowerShell@2
displayName: 'Run Style Check'

Просмотреть файл

@ -11,5 +11,5 @@ steps:
displayName: 'Publish AKS Deploy CLI extension as artifact'
inputs:
pathtoPublish: 'deploy-to-azure/dist'
artifactName: 'aks-deploy-cli-extension'
artifactName: 'deploy-to-azure-cli-extension'
publishLocation: 'Container'

Просмотреть файл

@ -4,7 +4,7 @@ steps:
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'aks-deploy-cli-extension'
artifactName: 'deploy-to-azure-cli-extension'
downloadPath: '$(System.ArtifactsDirectory)/extension'
- task: PowerShell@2

Просмотреть файл

@ -1,4 +1,4 @@
[![Build Status](https://dev.azure.com/baggaatul24/AKS-deploy-extension/_apis/build/status/GitHubActions-CliExtension-CI?branchName=master)](https://dev.azure.com/baggaatul24/AKS-deploy-extension/_build/latest?definitionId=168&branchName=master)
[![Build Status](https://dev.azure.com/deploy-to-azure-cli/deploy-to-azure-cli/_apis/build/status/Azure.deploy-to-azure-cli-extension?branchName=master)](https://dev.azure.com/deploy-to-azure-cli/deploy-to-azure-cli/_build/latest?definitionId=1&branchName=master)
# Azure CLI extension for deploying to Azure using GitHub Actions

Просмотреть файл

@ -1 +1 @@
recursive-include azext_aks_deploy/dev/resources/packs *
recursive-include azext_deploy_to_azure/dev/resources/packs *

Просмотреть файл

@ -10,20 +10,20 @@ class DevCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_type = CliCommandType(operations_tmpl='azext_aks_deploy#{}')
custom_type = CliCommandType(operations_tmpl='azext_deploy_to_azure#{}')
super(DevCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=custom_type)
def load_command_table(self, args):
from azext_aks_deploy.dev.aks.commands import load_aks_commands
from azext_aks_deploy.dev.functionapp.commands import load_functionapp_commands
from azext_deploy_to_azure.dev.aks.commands import load_aks_commands
from azext_deploy_to_azure.dev.functionapp.commands import load_functionapp_commands
load_aks_commands(self, args)
load_functionapp_commands(self, args)
return self.command_table
def load_arguments(self, command):
from azext_aks_deploy.dev.aks.arguments import load_aks_arguments
from azext_aks_deploy.dev.functionapp.arguments import load_functionapp_arguments
from azext_deploy_to_azure.dev.aks.arguments import load_aks_arguments
from azext_deploy_to_azure.dev.functionapp.arguments import load_functionapp_arguments
load_aks_arguments(self, command)
load_functionapp_arguments(self, command)

Просмотреть файл

@ -6,7 +6,7 @@
from azure.cli.core.commands import CliCommandType
aksops = CliCommandType(
operations_tmpl='azext_aks_deploy.dev.aks.up#{}'
operations_tmpl='azext_deploy_to_azure.dev.aks.up#{}'
)

Просмотреть файл

@ -7,9 +7,9 @@ import os
from os.path import dirname, abspath
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.const import (APP_NAME_DEFAULT, APP_NAME_PLACEHOLDER,
from azext_deploy_to_azure.dev.common.const import (APP_NAME_DEFAULT, APP_NAME_PLACEHOLDER,
PORT_NUMBER_PLACEHOLDER, ACR_PLACEHOLDER)
from azext_aks_deploy.dev.common.github_api_helper import Files\
from azext_deploy_to_azure.dev.common.github_api_helper import Files\
logger = get_logger(__name__)
PACKS_ROOT_STRING = os.path.sep + 'resources' + os.path.sep + 'packs' + os.path.sep

Просмотреть файл

@ -6,20 +6,20 @@
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.git import resolve_repository
from azext_aks_deploy.dev.common.github_api_helper import (Files, get_work_flow_check_runID,
from azext_deploy_to_azure.dev.common.git import resolve_repository
from azext_deploy_to_azure.dev.common.github_api_helper import (Files, get_work_flow_check_runID,
push_files_to_repository,
get_languages_for_repo,
get_github_pat_token,
get_default_branch,
check_file_exists)
from azext_aks_deploy.dev.common.github_workflow_helper import poll_workflow_status, get_new_workflow_yaml_name
from azext_aks_deploy.dev.common.github_azure_secrets import get_azure_credentials
from azext_aks_deploy.dev.common.kubectl import get_deployment_IP_port
from azext_aks_deploy.dev.common.const import (CHECKIN_MESSAGE_AKS, APP_NAME_DEFAULT, APP_NAME_PLACEHOLDER,
from azext_deploy_to_azure.dev.common.github_workflow_helper import poll_workflow_status, get_new_workflow_yaml_name
from azext_deploy_to_azure.dev.common.github_azure_secrets import get_azure_credentials
from azext_deploy_to_azure.dev.common.kubectl import get_deployment_IP_port
from azext_deploy_to_azure.dev.common.const import (CHECKIN_MESSAGE_AKS, APP_NAME_DEFAULT, APP_NAME_PLACEHOLDER,
ACR_PLACEHOLDER, RG_PLACEHOLDER, PORT_NUMBER_DEFAULT,
CLUSTER_PLACEHOLDER, RELEASE_PLACEHOLDER, RELEASE_NAME)
from azext_aks_deploy.dev.aks.docker_helm_template import get_docker_templates, get_helm_charts
from azext_deploy_to_azure.dev.aks.docker_helm_template import get_docker_templates, get_helm_charts
logger = get_logger(__name__)
aks_token_prefix = "AksAppUpCLIExt_"
@ -59,7 +59,7 @@ def aks_deploy(aks_cluster=None, acr=None, repository=None, port=None, branch_na
logger.debug('Languages detected : %s', languages)
raise CLIError('The languages in this repository are not yet supported from up command.')
from azext_aks_deploy.dev.common.azure_cli_resources import (get_aks_details,
from azext_deploy_to_azure.dev.common.azure_cli_resources import (get_aks_details,
get_acr_details,
configure_aks_credentials)
cluster_details = get_aks_details(aks_cluster)
@ -126,7 +126,7 @@ def get_yaml_template_for_repo(cluster_details, acr_details, repo_name):
if check_file_exists(repo_name, workflow_yaml):
yaml_file_name = get_new_workflow_yaml_name()
workflow_yaml = github_workflow_path + yaml_file_name
from azext_aks_deploy.dev.resources.resourcefiles import DEPLOY_TO_AKS_TEMPLATE
from azext_deploy_to_azure.dev.resources.resourcefiles import DEPLOY_TO_AKS_TEMPLATE
files_to_return.append(Files(path=workflow_yaml,
content=DEPLOY_TO_AKS_TEMPLATE
.replace(APP_NAME_PLACEHOLDER, APP_NAME_DEFAULT)

Просмотреть файл

@ -8,7 +8,7 @@ import json
from knack.log import get_logger
from knack.prompting import prompt
from knack.util import CLIError
from azext_aks_deploy.dev.common.prompting import prompt_user_friendly_choice_list
from azext_deploy_to_azure.dev.common.prompting import prompt_user_friendly_choice_list
logger = get_logger(__name__)

Просмотреть файл

@ -6,8 +6,8 @@ import time
import requests
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.prompting import prompt_user_friendly_choice_list, prompt_not_empty
from azext_aks_deploy.dev.common.git import resolve_git_ref_heads, get_branch_name_from_ref
from azext_deploy_to_azure.dev.common.prompting import prompt_user_friendly_choice_list, prompt_not_empty
from azext_deploy_to_azure.dev.common.git import resolve_git_ref_heads, get_branch_name_from_ref
logger = get_logger(__name__)
@ -23,7 +23,7 @@ class Files: # pylint: disable=too-few-public-methods
def get_github_pat_token(token_prefix, display_warning=False):
from azext_aks_deploy.dev.common.github_credential_manager import GithubCredentialManager
from azext_deploy_to_azure.dev.common.github_credential_manager import GithubCredentialManager
github_manager = GithubCredentialManager()
return github_manager.get_token(token_prefix=token_prefix, display_warning=display_warning)

Просмотреть файл

@ -5,8 +5,8 @@
from knack.log import get_logger
from knack.prompting import prompt
from azext_aks_deploy.dev.common.prompting import prompt_user_friendly_choice_list
from azext_aks_deploy.dev.common.azure_cli_resources import get_default_subscription_info
from azext_deploy_to_azure.dev.common.prompting import prompt_user_friendly_choice_list
from azext_deploy_to_azure.dev.common.azure_cli_resources import get_default_subscription_info
logger = get_logger(__name__)

Просмотреть файл

@ -8,7 +8,7 @@ import requests
from knack.prompting import prompt, prompt_pass
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.utils import time_now_as_string, singleton
from azext_deploy_to_azure.dev.common.utils import time_now_as_string, singleton
GITHUB_PAT_ENVKEY = "GITHUB_PAT"

Просмотреть файл

@ -7,8 +7,8 @@
from knack.util import CLIError
from knack.log import get_logger
from azext_aks_deploy.dev.common.github_api_helper import get_check_run_status_and_conclusion
from azext_aks_deploy.dev.common.prompting import prompt_not_empty
from azext_deploy_to_azure.dev.common.github_api_helper import get_check_run_status_and_conclusion
from azext_deploy_to_azure.dev.common.prompting import prompt_not_empty
logger = get_logger(__name__)

Просмотреть файл

@ -4,7 +4,7 @@
# --------------------------------------------------------------------------------------------
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.utils import which
from azext_deploy_to_azure.dev.common.utils import which
logger = get_logger(__name__)

Просмотреть файл

@ -6,7 +6,7 @@
from azure.cli.core.commands import CliCommandType
functionappops = CliCommandType(
operations_tmpl='azext_aks_deploy.dev.functionapp.up#{}'
operations_tmpl='azext_deploy_to_azure.dev.functionapp.up#{}'
)

Просмотреть файл

@ -5,16 +5,16 @@
from knack.log import get_logger
from knack.util import CLIError
from azext_aks_deploy.dev.common.git import resolve_repository
from azext_aks_deploy.dev.common.github_api_helper import (Files, get_work_flow_check_runID,
from azext_deploy_to_azure.dev.common.git import resolve_repository
from azext_deploy_to_azure.dev.common.github_api_helper import (Files, get_work_flow_check_runID,
push_files_to_repository,
get_languages_for_repo,
get_github_pat_token,
get_default_branch,
check_file_exists)
from azext_aks_deploy.dev.common.github_workflow_helper import poll_workflow_status
from azext_aks_deploy.dev.common.github_azure_secrets import get_azure_credentials_functionapp
from azext_aks_deploy.dev.common.const import CHECKIN_MESSAGE_FUNCTIONAPP
from azext_deploy_to_azure.dev.common.github_workflow_helper import poll_workflow_status
from azext_deploy_to_azure.dev.common.github_azure_secrets import get_azure_credentials_functionapp
from azext_deploy_to_azure.dev.common.const import CHECKIN_MESSAGE_FUNCTIONAPP
logger = get_logger(__name__)
functionapp_token_prefix = "FunctionAppUpCLIExt_"
@ -53,7 +53,7 @@ def functionapp_deploy(app_name=None, repository=None, skip_secrets_generation=F
# Todo - atbagga
ensure_function_app(repo_name=repo_name)
from azext_aks_deploy.dev.common.azure_cli_resources import get_functionapp_details
from azext_deploy_to_azure.dev.common.azure_cli_resources import get_functionapp_details
app_details = get_functionapp_details(app_name)
logger.debug(app_details)
app_name = app_details['name']
@ -101,11 +101,11 @@ def get_functionapp_yaml_template_for_repo(app_name, repo_name):
yaml_file_name = 'main.yml'
workflow_yaml = github_workflow_path + yaml_file_name
if check_file_exists(repo_name, workflow_yaml):
from azext_aks_deploy.dev.common.github_workflow_helper import get_new_workflow_yaml_name
from azext_deploy_to_azure.dev.common.github_workflow_helper import get_new_workflow_yaml_name
yaml_file_name = get_new_workflow_yaml_name()
workflow_yaml = github_workflow_path + yaml_file_name
from azext_aks_deploy.dev.resources.resourcefiles import DEPLOY_TO_FUNCTIONAPP_TEMPLATE
from azext_aks_deploy.dev.common.const import APP_NAME_PLACEHOLDER
from azext_deploy_to_azure.dev.resources.resourcefiles import DEPLOY_TO_FUNCTIONAPP_TEMPLATE
from azext_deploy_to_azure.dev.common.const import APP_NAME_PLACEHOLDER
files_to_return.append(Files(path=workflow_yaml,
content=DEPLOY_TO_FUNCTIONAPP_TEMPLATE
.replace(APP_NAME_PLACEHOLDER, app_name)))

Просмотреть файл

@ -8,7 +8,7 @@ import re
from codecs import open
from setuptools import setup, find_packages
NAME = 'aks-deploy'
NAME = 'deploy-to-azure'
# To install the library, run the following
#
@ -21,7 +21,7 @@ REQUIRES = [
]
# Version extraction inspired from 'requests'
with open(os.path.join('azext_aks_deploy', 'version.py'), 'r') as fd:
with open(os.path.join('azext_deploy_to_azure', 'version.py'), 'r') as fd:
VERSION = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
@ -50,14 +50,14 @@ with open('HISTORY.rst', 'r', encoding='utf-8') as f:
setup(
name=NAME,
version=VERSION,
description="Extension to deploy to AKS.",
description="Extension to deploy to Azure.",
long_description=README + '\n\n' + HISTORY,
license='MIT',
author="Microsoft",
author_email="VSTS_Social@microsoft.com",
url="https://github.com/atbagga/aks-deploy-cli-extension",
classifiers=CLASSIFIERS,
package_data={'azext_aks_deploy': ['azext_metadata.json']},
package_data={'azext_deploy_to_azure': ['azext_metadata.json']},
packages=find_packages(exclude=["*.test", "*.test.*", "test.*", "test"]),
include_package_data=True,
install_requires=REQUIRES

Просмотреть файл

@ -7,7 +7,7 @@ Write-Output "Installing flake8"
python -m pip install --user flake8
Write-Output "Running pylint on all source"
python -m pylint --rcfile pylintrc ./deploy-to-azure/azext_aks_deploy -f colorized
python -m pylint --rcfile pylintrc ./deploy-to-azure/azext_deploy_to_azure -f colorized
if ($LastExitCode -ne 0) {
$failure = $true