-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Integrate Availability Zone from private repository #4523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
8f5ef2b
7436a62
9e79e60
9f071df
1b2bcc2
1db07c3
4ec859c
9757370
cebafe6
157ca06
6d751d3
e505c66
881353c
1bb2ef0
64afaa3
7458d24
e82f1d0
0baf2c1
2aa24b8
ceb0d44
6577c45
493d42a
d205eb1
b0d81f8
c396c1c
d7586ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| """ | ||
| Script to build all command modules that can be used to install a fully self-contained instance of the CLI. | ||
| """ | ||
|
|
||
| from __future__ import print_function | ||
|
|
||
| import glob | ||
| import os | ||
| import sys | ||
| import tempfile | ||
| import subprocess | ||
|
|
||
| def _error_exit(msg): | ||
| print('ERROR: '+msg, file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
| def _print_status(msg=''): | ||
| print('-- '+msg) | ||
|
|
||
| def _get_tmp_dir(): | ||
| return tempfile.mkdtemp() | ||
|
|
||
| def _get_tmp_file(): | ||
| return tempfile.mkstemp()[1] | ||
|
|
||
| def _exec_command(command_list, cwd=None, stdout=None): | ||
| """Returns True in the command was executed successfully""" | ||
| try: | ||
| _print_status('Executing {}'.format(command_list)) | ||
| subprocess.check_call(command_list, stdout=stdout, cwd=cwd) | ||
| return True | ||
| except subprocess.CalledProcessError as err: | ||
| print(err, file=sys.stderr) | ||
| return False | ||
|
|
||
| def _build_package(path_to_package, dist_dir): | ||
| cmd_success = _exec_command(['python', 'setup.py', 'bdist_wheel', '-d', dist_dir], cwd=path_to_package) | ||
| if not cmd_success: | ||
| _error_exit('Error building {}.'.format(path_to_package)) | ||
|
|
||
| def build_packages(clone_root, dist_dir): | ||
| packages_to_build = [ | ||
| os.path.join(clone_root, 'src', 'azure-cli'), | ||
| os.path.join(clone_root, 'src', 'azure-cli-core'), | ||
| os.path.join(clone_root, 'src', 'azure-cli-nspkg'), | ||
| os.path.join(clone_root, 'src', 'azure-cli-command_modules-nspkg'), | ||
| ] | ||
|
|
||
| packages_to_build.extend(glob.glob(os.path.join(clone_root, 'src', 'command_modules', 'azure-cli-*'))) | ||
| for p in packages_to_build: | ||
| if os.path.isfile(os.path.join(p, 'setup.py')): | ||
| _build_package(p, dist_dir) | ||
|
|
||
| if __name__ == '__main__': | ||
| if len(sys.argv) == 1: | ||
| raise ValueError('Please provide temporary path for local built packages') | ||
| dist_dir = sys.argv[1] | ||
| clone_root = sys.argv[2] | ||
| build_packages(clone_root, dist_dir) | ||
| print("package were built to {}".format(dist_dir)) | ||
| print("Done.") |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR does more than "Integrate Availability Zone from private repository". It also introduces Later in #4696, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| @echo off | ||
| SetLocal EnableDelayedExpansion | ||
| echo build a msi installer using local cli sources and python executables. You need to have curl.exe, unzip.exe and msbuild.exe available under PATH | ||
| echo. | ||
|
|
||
| set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin" | ||
|
|
||
| if "%CLIVERSION%"=="" ( | ||
| echo Please set the CLIVERSION environment variable, e.g. 2.0.13 | ||
| goto ERROR | ||
| ) | ||
| set PYTHON_VERSION=3.6.1 | ||
|
|
||
| set WIX_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip" | ||
|
|
||
| :: Set up the output directory and temp. directories | ||
| echo Cleaning previous build artifacts... | ||
| set OUTPUT_DIR=%~dp0..\out | ||
| if exist %OUTPUT_DIR% rmdir /s /q %OUTPUT_DIR% | ||
| mkdir %OUTPUT_DIR% | ||
|
|
||
| set TEMP_SCRATCH_FOLDER=%HOMEDRIVE%%HOMEPATH%\zcli_scratch | ||
| set BUILDING_DIR=%HOMEDRIVE%%HOMEPATH%\zcli | ||
| set WIX_DIR=%HOMEDRIVE%%HOMEPATH%\zwix | ||
| set REPO_ROOT=%~dp0..\..\.. | ||
|
|
||
| :: look for python 3.x so we can build into the installer | ||
| if not "%1"=="" ( | ||
| set PYTHON_DIR=%1 | ||
| set PYTHON_EXE=%1\python.exe | ||
| goto PYTHON_FOUND | ||
| ) | ||
|
|
||
| FOR /f %%i IN ('where python') DO ( | ||
| set PY_FILE_DRIVE=%%~di | ||
| set PY_FILE_PATH=%%~pi | ||
| set PY_FILE_NAME=%%~ni | ||
| set PYTHON_EXE=!PY_FILE_DRIVE!!PY_FILE_PATH!!PY_FILE_NAME!.exe | ||
| set PYTHON_DIR=!PY_FILE_DRIVE!!PY_FILE_PATH! | ||
| FOR /F "delims=" %%j IN ('!PYTHON_EXE! --version') DO ( | ||
| set PYTHON_VER=%%j | ||
| echo.!PYTHON_VER!|findstr /C:"%PYTHON_VERSION%" >nul 2>&1 | ||
| if not errorlevel 1 ( | ||
| goto PYTHON_FOUND | ||
| ) | ||
| ) | ||
| ) | ||
| echo python %PYTHON_VERSION% is needed to create installer. | ||
| exit /b 1 | ||
| :PYTHON_FOUND | ||
| echo Python Executables: %PYTHON_DIR%, %PYTHON_EXE% | ||
|
|
||
| ::reset working folders | ||
| if exist %BUILDING_DIR% rmdir /s /q %BUILDING_DIR% | ||
| ::rmdir always returns 0, so check folder's existence | ||
| if exist %BUILDING_DIR% ( | ||
| echo Failed to delete %BUILDING_DIR%. | ||
| goto ERROR | ||
| ) | ||
| mkdir %BUILDING_DIR% | ||
|
|
||
| if exist %TEMP_SCRATCH_FOLDER% rmdir /s /q %TEMP_SCRATCH_FOLDER% | ||
| if exist %TEMP_SCRATCH_FOLDER% ( | ||
| echo Failed to delete %TEMP_SCRATCH_FOLDER%. | ||
| goto ERROR | ||
| ) | ||
| mkdir %TEMP_SCRATCH_FOLDER% | ||
|
|
||
| copy %REPO_ROOT%\privates\*.whl %TEMP_SCRATCH_FOLDER% | ||
|
|
||
| ::ensure wix is available | ||
| if exist %WIX_DIR% ( | ||
| echo Using existing Wix at %WIX_DIR% | ||
| ) | ||
| if not exist %WIX_DIR% ( | ||
| mkdir %WIX_DIR% | ||
| pushd %WIX_DIR% | ||
| echo Downloading Wix. | ||
| curl -o wix-archive.zip %WIX_DOWNLOAD_URL% -k | ||
| unzip -q wix-archive.zip | ||
| if %errorlevel% neq 0 goto ERROR | ||
| del wix-archive.zip | ||
| echo Wix downloaded and extracted successfully. | ||
| popd | ||
| ) | ||
|
|
||
| :: Use the Python version on the machine that creates the MSI | ||
| robocopy %PYTHON_DIR% %BUILDING_DIR% /s /NFL /NDL | ||
|
|
||
| :: Build & install all the packages with bdist_wheel | ||
| %BUILDING_DIR%\python %~dp0build-packages.py %TEMP_SCRATCH_FOLDER% %REPO_ROOT% | ||
| if %errorlevel% neq 0 goto ERROR | ||
| :: Install them to the temp folder so to be packaged | ||
| %BUILDING_DIR%\python.exe -m pip install -f %TEMP_SCRATCH_FOLDER% --no-cache-dir azure-cli | ||
| %BUILDING_DIR%\python.exe -m pip install --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg | ||
|
|
||
| echo Creating the wbin (Windows binaries) folder that will be added to the path... | ||
| mkdir %BUILDING_DIR%\wbin | ||
| copy %REPO_ROOT%\packaged_releases\windows\scripts\az.cmd %BUILDING_DIR%\wbin\ | ||
| if %errorlevel% neq 0 goto ERROR | ||
| copy %REPO_ROOT%\packaged_releases\windows\resources\CLI_LICENSE.rtf %BUILDING_DIR% | ||
| copy %REPO_ROOT%\packaged_releases\windows\resources\ThirdPartyNotices.txt %BUILDING_DIR% | ||
| del %BUILDING_DIR%\Scripts\pip.exe | ||
| del %BUILDING_DIR%\Scripts\pip3.exe | ||
| del %BUILDING_DIR%\Scripts\pip3.6.exe | ||
| if %errorlevel% neq 0 goto ERROR | ||
|
|
||
| echo Building MSI... | ||
| msbuild /t:rebuild /p:Configuration=Release %REPO_ROOT%\packaged_releases\windows\azure-cli.wixproj | ||
|
|
||
| start %OUTPUT_DIR% | ||
|
|
||
| goto END | ||
|
|
||
| :ERROR | ||
| echo Error occurred, please check the output for details. | ||
| exit /b 1 | ||
|
|
||
| :END | ||
| exit /b 0 | ||
| popd |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods | |
|
|
||
| MGMT_STORAGE = ('azure.mgmt.storage', | ||
| 'StorageManagementClient') | ||
| MGMT_COMPUTE = ('azure.mgmt.compute.compute', | ||
| MGMT_COMPUTE = ('azure.mgmt.compute', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the new SDK, is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
| 'ComputeManagementClient') | ||
| MGMT_NETWORK = ('azure.mgmt.network', | ||
| 'NetworkManagementClient') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ unreleased | |
|
|
||
| 2.0.12 (2017-08-11) | ||
| +++++++++++++++++++ | ||
| * `public-ip`: Add availability zone support. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be in |
||
| * `lb`: fixed issue where the certain child resource names did not resolve correctly when omitted | ||
| * `application-gateway {subresource} delete`: Fixed issue where `--no-wait` was not honored. | ||
| * `application-gateway http-settings update`: Fix issue where `--connection-draining-timeout` could not be turned off. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still needed. Troy Dai (@troydai)?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derek Bekoe (@derekbekoe), I will undo this when SDK gets published. The roll back list is being tracked at
https://github.com/Azure/azure-cli-pr/issues/13