Skip to content

Commit

Permalink
Merge upstream changes (#293)
Browse files Browse the repository at this point in the history
* Progress (Azure#7558)

* update knack 0.4.4 (Azure#7567)

* Update CODEOWNERS (Azure#7571)

* Add table for exit codes (Azure#7572)

* Updated adls version to 0.0.34 (Azure#7570)

* Updated adls version to 0.0.33

* Updated version

* Update version

* Downgrade to 0.0.32 due to test failures

* Updated test recordings with new version and updated to version 0.0.34 again

* Updated History.rst

* Merge CLI 2.0.48 hotfix to dev and bump versions (Azure#7590)

* Homebrew hotfix.

* CI issue?

* make scrubbed over value valid base64 (Azure#7592)

* Graph: support add/remove/list owners on app, sp, and group (Azure#7578)

* Container Instance: Updating VNET workflow (Azure#7517)

* Adding vnet-resource-group

* fixing wording for more clear content

* Removing vnet-resource-group

* allow passing in vnet name or id

* updating container module version

* adding wording change for the LRP in container warning.

* reverting version back to current version

* Adding private option for --ip-address

* updating tests for new parameters

* updating tests recordings

* Removing the ability to create VNET by passing the resource ID

* adding --vnet-name back for backwards compatability

* Fixing based on feedback

* Bumping the version for CItests

* updating container instance sdk version

* changing casing and removing existance check

* fixing no image error validation

* Fix CI. Remove autopep8 dependency (Azure#7597)

* Update tools setup.

* Remove autopep8

* Iot Central Added Display Name and Template Parameters for App Create (Azure#7518)

* [Storage] allow deletion of containers with immutability policy after service bug fix (Azure#7569)

* delete container to custom command

* finished up commands

* added test

* history and pep8

* linter, static

* new recording after scrubbing fix

* comment typo

* vmss: avoid producing useless stroage accounts with unmanaegd scaleset (Azure#7601)

* [Monitor] Fix `activity-log list` issues. (Azure#7525)

* Fix Azure#5608. Fix Azure#4885.

* Update Metric command.

* Container Instance: Role Assignment for System Assigned MSI (Azure#7577)

* adding deployment based for resources

* changing to sdk calls for role assignment

* Fixing naming problem causing authorization client to fail

* Fixing formatting errors

* fixing differnt return statemnet errors

* adding tests for the --scope parameter

* fixing conflicts in recordings

* fixing conflicts and rerecording tests

* removing whitespace

* making non predictble test live only

* Fixing blank lines

* allow role assignment for --no-wait aswell

* removed unused imports

* CLI now prints extension messages. E.g. This extension is in preview. The behavior of this command has been altered by the following extension: storage-preview (Azure#7606)

* Removing Warnings for Cloudshell Proxy (Azure#7605)

* removing warnings for cloudshell proxy

* updating code owners for the container modules

* Updating how env var is accessed

* fixing formatting error in string message

* removing unused import

* Bump versions for next CLI release (Azure#7610)

* AAD Graph: support grant/list app permissions(Azure#7611)

Contributed by: @shanepeckham
Payload details: https://blogs.msdn.microsoft.com/arsen/2017/07/30/azure-ad-how-to-create-oauth2permissiongrant-using-graph-api-grant-permissions-and-consent-for-application/

* Fixes Azure#7596. (Azure#7620)

* Retry webbrowser.open() after a TypeError (Azure#7542)

* [Monitor] Metric alerts - allow special characters in metric name (Azure#7623)

* Fixes Azure#7598.

* Add test.

* Closes Azure#7545.

* moved interactive events to core (Azure#7632)

* Fixed bug where --no-wait option causes vm resize to crash. (Azure#7627)

* Fixed bug where --no-wait option causes vm resize to crash.

* Bump up VM version number

* Update rdbms help examples text from Gen4 to Gen5 (Azure#7642)

* Update rdbms help examples text from Gen4 to Gen5

* Fix version

* Fix public-ip create. (Azure#7638)

* image create now accepts a storage-sku.  (Azure#7614)

* image create now accepts a storage-sku. Unused when source is a VM due to service side issue. Also updated help text and made some changes to some model imports.

* Updated storage-sku help parameter

* Fixed bug introduced by using get_models. For profiles that don't have StorageAccountTypes defined define the possible storage-sku values.

* History changes.

* Bumped up VM version number.

removed extra newline in History.rst

* Added test coverage for --storage-sku

* Comment explaining else statement in vm/_params.py

* Modified  test_vm_managed_disk

* Addressed pep8 warnings.

* ACR: Add Pull Request Event to Task Source Trigger (Azure#7526)

* initial work on the PR trigger

* task create and update with PR trigger

* use one flag to enable commit and pr trigger events

* nit fixes

* Two event flags and only support one source trigger per task

* PR fixes

* allow empty event list when disabling all trigger events

* format fix

* do not clear event list in update, instead status disabled

* update task table

* nit fix

* bump cli event version

* nit fixes

* update ACR sdk version

* version fix

* update appservice version

* pylint fixes

* pylint fixes

* nit

* pylint fix

* respond to PR comments

* change from null to empty check

* ad: clarify the confusion between displayName and service principal name (Azure#7651)

* [setup]: windows installer improvement (Azure#7633)

* revert to desktop python

* change before do model file concat

* add trimmer

* revert an unrelated change

* incorporate model file trimmer

* revert a few unnecessary change

* lint fix

* remove an irrelevant command file

* backup python to storage accounts

* remove irrelevant comment

* simplify

* Closes Azure#7536 (Azure#7626)

* pin flake8 to 3.5.0 (Azure#7663)

* pin flake8 to 3.5.0

* wrong version

* setup: add back the workaround of pinning pycparser==2.18 (Azure#7662)

* Fixed bug with update --remove --ids (Azure#7643)

* Fixed bug where if update --remove is called with --ids, the correct params aren't passed in subsequent iterations of the update command.

* Fixed Pep8 issues

* Fixed bug by changing generic update logic instead of copying CLI params.

* Move extension logic into core (Azure#7653)

* moved previous 'extensions' event handling logic

* moved all extension management utility to core

* fix ref

static checking

fix test import

* core package

* fix reference

* renamed to register_global_transforms

* Update to latest Advisor SDK (Azure#7576)

* Updates for GA release.

* Addressing PR feedback:
- Removed 'recommendation generate' command and added a '--refresh' option to 'recommendation list' instead.
- Renamed 'configuration get' to 'configuration list'.
- Renamed 'configuration set' to 'configuration update'.
- Test recording updates.

* Update history with details of the changes.

* Adding generic update and show command.

* Addressing review feedback.

* Update SDK package version.

* Addressing review feedback.

* Fix indentation errors.

* Add support for ids.

* Updates for GA release.

* Addressing PR feedback:
- Removed 'recommendation generate' command and added a '--refresh' option to 'recommendation list' instead.
- Renamed 'configuration get' to 'configuration list'.
- Renamed 'configuration set' to 'configuration update'.
- Test recording updates.

* Update history with details of the changes.

* Adding generic update and show command.

* Addressing review feedback.

* Update SDK package version.

* Addressing review feedback.

* Fix indentation errors.

* Add support for ids.

* Fix test failures.

* Update to latest SDK version

* Update history

* Reference new package version

* Fixed non-working example for mysql db create (Azure#7557)

* Update _help.py

Fixed non-working example with guidance from 
https://docs.microsoft.com/en-us/azure/mysql/quickstart-create-mysql-server-database-using-azure-cli

* Update HISTORY.rst

* Update setup.py

* Fix placeholder

* Fix Azure#7659 (Azure#7668)
  • Loading branch information
jaysterp authored Oct 25, 2018
1 parent 932003e commit 3941f6f
Show file tree
Hide file tree
Showing 191 changed files with 7,618 additions and 3,467 deletions.
12 changes: 6 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

*help.py @sptramer

/tools/ @troydai
/scripts/ @troydai
/src/azure-cli-testsdk/ @troydai
/tools/ @tjprescott
/scripts/ @tjprescott
/src/azure-cli-testsdk/ @tjprescott
/src/command_modules/azure-cli-acr/ @djyou
/src/command_modules/azure-cli-acs/ @rjtsdl
/src/command_modules/azure-cli-advisor/ @Prasanna-Padmanabhan
Expand All @@ -15,17 +15,17 @@
/src/command_modules/azure-cli-cdn/ @tjprescott
/src/command_modules/azure-cli-cosmosdb/ @dmakwana
/src/command_modules/azure-cli-cloud/ @yugangw-msft
/src/command_modules/azure-cli-container/ @yolo3301
/src/command_modules/azure-cli-container/ @samkreter
/src/command_modules/azure-cli-consumption/ @sandeepnl
/src/command_modules/azure-cli-dls/ @lewu-msft
/src/command_modules/azure-cli-eventgrid/ @kalyanaj
/src/command_modules/azure-cli-extension/ @williexu
/src/command_modules/azure-cli-keyvault/ @tjprescott
/src/command_modules/azure-cli-monitor/ @troydai
/src/command_modules/azure-cli-monitor/ @tjprescott
/src/command_modules/azure-cli-network/ @tjprescott
/src/command_modules/azure-cli-policyinsights/ @bulentelmaci
/src/command_modules/azure-cli-profile/ @yugangw-msft
/src/command_modules/azure-cli-storage/ @troydai @williexu
/src/command_modules/azure-cli-storage/ @williexu
/src/command_modules/azure-cli-servicefabric/ @QingChenmsft
/src/command_modules/azure-cli-sql/ @jaredmoo
/src/command_modules/azure-cli-vm/ @yugangw-msft
Expand Down
6 changes: 0 additions & 6 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,13 @@ jasonsha@MyVM:~$

#### Exit Codes
For scripting purposes, we output certain exit codes for differing scenarios.
`0`: Command ran successfully.
`1`: Generic error; server returned bad status code, CLI validation failed, etc.
`2`: Parser error; check input to command line.
`3`: Missing ARM resource; used for existence check from `show` commands.

|Exit Code |Scenario |
|---|---|
|0 |Command ran successfully. |
|1 |Generic error; server returned bad status code, CLI validation failed, etc. |
|2 |Parser error; check input to command line. |
|3 |Missing ARM resource; used for existence check from `show` commands. |

#### More Samples and Snippets
For more usage examples, take a look at our [GitHub samples repo](http://github.com/Azure/azure-cli-samples) or [https://docs.microsoft.com/en-us/cli/azure/overview](https://docs.microsoft.com/en-us/cli/azure/overview).
Expand Down
212 changes: 210 additions & 2 deletions azure-cli2017.pyproj

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions build_scripts/debian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Debian Packaging
================

Updating the Debian package
---------------------------

On a build machine (e.g. new Ubuntu 14.04 VM), run the build script.

For example:
```
git clone https://github.com/azure/azure-cli
cd azure-cli
export CLI_VERSION=2.0.9 \
&& export BUILD_ARTIFACT_DIR=$(mktemp -d)\
&& build_scripts/debian/build.sh $(pwd)
```

Note: The paths above have to be full paths, not relative otherwise the build will fail.

Now you have built the package, upload the package to the apt repository.


Verification
------------

```
sudo dpkg -i azure-cli_${CLI_VERSION}-1_all.deb
az
az --version
```
79 changes: 79 additions & 0 deletions build_scripts/debian/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------

set -ex

: "${CLI_VERSION:?CLI_VERSION environment variable not set.}"
: "${BUILD_ARTIFACT_DIR:?BUILD_ARTIFACT_DIR environment variable not set.}"

if [ -z "$1" ]
then
echo "Argument should be path to local repo."
exit 1
fi

local_repo=$1

sudo apt-get update

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
debian_directory_creator=$script_dir/dir_creator.sh

# Install dependencies for the build
sudo apt-get install -y libssl-dev libffi-dev python3-dev debhelper
# Download, Extract, Patch, Build CLI
tmp_pkg_dir=$(mktemp -d)
working_dir=$(mktemp -d)
cd $working_dir
source_dir=$local_repo
deb_file=$local_repo/../azure-cli_${CLI_VERSION}-${CLI_VERSION_REVISION:=1}_all.deb
az_completion_file=$source_dir/az.completion
# clean up old build output
if [ -d "$source_dir/debian" ]
then
rm -rf $source_dir/debian
fi
[ -d $local_repo/privates ] && cp $local_repo/privates/*.whl $tmp_pkg_dir

# Build Python from source and include
python_dir=$(mktemp -d)
python_archive=$(mktemp)
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz -qO $python_archive
tar -xvzf $python_archive -C $python_dir
echo "Python dir is $python_dir"
# clean any previous make files
make clean || echo "Nothing to clean"
$python_dir/*/configure --srcdir $python_dir/* --prefix $source_dir/python_env
make
# required to run the 'make install'
sudo apt-get install -y zlib1g-dev
make install

# note: This installation step could happen in debian/rules but was unable to escape $ char.
# It does not affect the built .deb file though.
$source_dir/python_env/bin/pip3 install wheel
for d in $source_dir/src/azure-cli $source_dir/src/azure-cli-core $source_dir/src/azure-cli-nspkg \
$source_dir/src/azure-cli-command_modules-nspkg $source_dir/src/command_modules/azure-cli-*/;
do cd $d;
$source_dir/python_env/bin/python3 setup.py bdist_wheel -d $tmp_pkg_dir;
cd -;
done;
all_modules=`find $tmp_pkg_dir -name "*.whl"`
$source_dir/python_env/bin/pip3 install $all_modules
$source_dir/python_env/bin/pip3 install --force-reinstall --upgrade azure-nspkg azure-mgmt-nspkg
# Add the debian files
mkdir $source_dir/debian
# Create temp dir for the debian/ directory used for CLI build.
cli_debian_dir_tmp=$(mktemp -d)

$debian_directory_creator $cli_debian_dir_tmp $az_completion_file $source_dir
cp -r $cli_debian_dir_tmp/* $source_dir/debian
cd $source_dir
dpkg-buildpackage -us -uc
echo "The archive is available at $working_dir/azure-cli_${CLI_VERSION}-${CLI_VERSION_REVISION:=1}_all.deb"
cp $deb_file ${BUILD_ARTIFACT_DIR}
echo "The archive has also been copied to ${BUILD_ARTIFACT_DIR}"
echo "Done."
124 changes: 124 additions & 0 deletions build_scripts/debian/dir_creator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#!/usr/bin/env bash
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------

set -ex

# Create the debian/ directory for building the azure-cli Debian package

# This script takes an argument of the empty directory where the files will be placed.

if [ -z "$1" ]
then
echo "No argument supplied for debian directory."
exit 1
fi

if [ -z "$2" ]
then
echo "No argument supplied for completion script."
exit 1
fi

if [ -z "$3" ]
then
echo "No argument supplied for source directory."
exit 1
fi

TAB=$'\t'

debian_dir=$1
completion_script=$2
source_dir=$3
mkdir $debian_dir/source

echo '1.0' > $debian_dir/source/format
echo '9' > $debian_dir/compat

cat > $debian_dir/changelog <<- EOM
azure-cli (${CLI_VERSION}-${CLI_VERSION_REVISION:=1}) unstable; urgency=low
* Debian package release.
-- Azure Python CLI Team <[email protected]> $(date -R)
EOM

cat > $debian_dir/control <<- EOM
Source: azure-cli
Section: python
Priority: extra
Maintainer: Azure Python CLI Team <[email protected]>
Build-Depends: debhelper (>= 9), libssl-dev, libffi-dev, python3-dev
Standards-Version: 3.9.5
Homepage: https://github.com/azure/azure-cli
Package: azure-cli
Architecture: all
Depends: \${shlibs:Depends}, \${misc:Depends}
Description: Azure CLI
A great cloud needs great tools; we're excited to introduce Azure CLI,
our next generation multi-platform command line experience for Azure.
EOM

cat > $debian_dir/copyright <<- EOM
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: azure-cli
Upstream-Contact: Azure Python CLI Team <[email protected]>
Source: https://github.com/azure/azure-cli
Files: *
Copyright: Copyright (c) Microsoft Corporation
License: MIT
Azure CLI
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
EOM

# TODO: Instead of "_ssl.cpython-36m-x86_64-linux-gnu.so" only, find all .so files with "find debian/azure-cli/opt/az -type f -name '*.so'"

cat > $debian_dir/rules << EOM
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DH_OPTIONS=-v
%:
${TAB}dh \$@ --sourcedirectory $source_dir
override_dh_install:
${TAB}mkdir -p debian/azure-cli/opt/az
${TAB}cp -a python_env/* debian/azure-cli/opt/az
${TAB}mkdir -p debian/azure-cli/usr/bin/
${TAB}echo "\043!/usr/bin/env bash\n/opt/az/bin/python3 -Im azure.cli \"\044\100\"" > debian/azure-cli/usr/bin/az
${TAB}chmod 0755 debian/azure-cli/usr/bin/az
${TAB}mkdir -p debian/azure-cli/etc/bash_completion.d/
${TAB}cat ${completion_script} > debian/azure-cli/etc/bash_completion.d/azure-cli
${TAB}dpkg-shlibdeps -v --warnings=7 -Tdebian/azure-cli.substvars -dDepends -edebian/azure-cli/opt/az/bin/python3 debian/azure-cli/opt/az/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so
override_dh_strip:
${TAB}dh_strip --exclude=_cffi_backend
EOM

cat $debian_dir/rules

# debian/rules should be executable
chmod 0755 $debian_dir/rules
35 changes: 35 additions & 0 deletions build_scripts/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Docker Packaging
================

The Docker image is available at https://hub.docker.com/r/microsoft/azure-cli/tags/.

Updating the Docker image
-------------------------
1. Run `docker build` with the Dockerfile.
When tagging this Docker image, choose an appropriate version number.
e.g.: ``sudo docker build --no-cache --build-arg BUILD_DATE="`date -u +"%Y-%m-%dT%H:%M:%SZ"`" --build-arg CLI_VERSION=${CLI_VERSION} -f Dockerfile -t microsoft/azure-cli:${CLI_VERSION} .``
2. Push the image to the registry,
e.g.: `sudo docker push microsoft/azure-cli:${CLI_VERSION}`
3. Create a PR to commit the Dockerfile changes back to the repository.


Verification
------------

Run the image.

```
$ docker run -it microsoft/azure-cli:${CLI_VERSION}
$ az
$ az --version
```

Save the image
```
docker save -o docker-microsoft-azure-cli-VERSION.tar microsoft/azure-cli:${CLI_VERSION}
```

Load the saved image
```
docker load -i docker-microsoft-azure-cli-VERSION.tar
```
35 changes: 35 additions & 0 deletions build_scripts/homebrew/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Homebrew Packaging
==================


Updating the formula
--------------------
1. Change the `url` in the formula to point to the new release and change the `sha256` value also.
2. Update the resources list in the formula (see below).
3. Run the formula verification commands (see below).
4. Submit a PR to https://github.com/Homebrew/homebrew-core.


Updating the resources list
---------------------------
```
# Create a new virtual environment first
pip install azure-cli homebrew-pypi-poet; poet -r azure-cli
```

Verification
------------

```
brew install --build-from-source azure-cli.rb
brew test azure-cli.rb
brew audit --strict --online azure-cli.rb
```

More Information
----------------
https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md

https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md

https://github.com/Homebrew/brew/blob/master/docs/Acceptable-Formulae.md
Loading

0 comments on commit 3941f6f

Please sign in to comment.