azure容器服务命令行工具
acs的Python项目详细描述
注意:不用于生产
请注意,这些脚本旨在允许使用 azure容器服务。它们不是生产用的。
一组用于创建和测试acs的方便脚本 集群。这些脚本还可以帮助您了解如何使用 rest api接口用于管理acs集群上的应用程序。
#用法
请参阅[文档](http://rgardler.github.io/acs-cli)。
#开发
##先决条件
- Python 3
- apt-get install python
- [PIP](https://pip.pypa.io/en/stable/installing/)
- Azure CLI installed and configured to access the test subscription * install Node and NPM * sudo npm install azure-cli -g
##准备
要安装所有库和开发依赖项:
` sudo pip install -e . sudo pip install -e .[test] `
##一般用途
您可以使用acs–help获取基本帮助,或查看 [文档](http://rgardler.github.com/acs-cli)。
#开发
##添加命令
要添加表示新功能的顶级命令,请遵循 这些步骤(在本例中,新命令称为foo:
- Add the command foo and its description to the “Commands” section of the docstring for acs/cli.py
- Copy acs/commands/command.tmpl to acs/commands/foo.py * Add the subcommands and options to the docstring of the foo.py file * Implement each command in a method using the same name as the command
- Add foo.py import to acs/commands/__init__.py
- Copy tests/command/test_command.tmpl to test/command/test_foo.py * Implement the tests
- Run the tests with python setup.py test and iterate as necessary
- Install the package with python setup.py install
##添加子命令
子命令应用于命令,要添加子命令,请执行以下操作:
- Add the subcommand to the docstring of the relevant command class (e.g. foo.bar)
- Add a method with the same name as the subcommand
- Add a test
- Run the tests with python setup.py test and iterate as necessary
- Install the package with python setup.py install
##测试
使用[py.test:](http://pytest.org/latest)和[coverage]运行测试(https://pypi.python.org/pypi/pytest cov):
` python setup.py test `
注意,默认情况下,这不会运行慢速测试(如创建 群集和安装功能。因此,您必须首先至少运行一次完整的测试套件。您可以使用:
` py.test --runslow `
##释放
剪切发行版并发布到[python包 索引](https://pypi.python.org/pypi)安装 [绳线](http://pypi.python.org/pypi/twine。然后运行:
` python setup.py sdist bdist_wheel twine upload dist/* `
这将建立一个surce tarball和一个车轮,这将运行 在所有平台上。
###更新文档
创建和折叠文档:
` cd docs make gh-pages cd .. `