没有项目描述
wcm的Python项目详细描述
WCM-Wings组件管理器
安装
pip install wcm
cli
wcm
wings组件管理器是一个cli实用程序,用于publish
和download
wings组件到wings实例。
$ wcm --help Usage: wcm [OPTIONS] COMMAND [ARGS]... Options: -v, --verbose --help Show this message and exit. Commands: configure Configure credentials download Download a component from the wings server. init Initialize a directory for a new component. list Lists all the components in the current wings instance publish Deploy the pacakge to the wcm. version Show wcm version.
configure
子命令用于设置wcm
用于与wings服务器交互的凭据。
$ wcm configure --help Usage: wcm configure [OPTIONS] Configure credentials Options: -p, --profile <profile-name> --help Show this message and exit.
init
子命令用于初始化文件系统上的新wings组件。
$ wcm init --help Usage: wcm init [OPTIONS][COMPONENT] Initialize a directory for a new component. Options: -y, --yes --help Show this message and exit.
publish
子命令将组件发布到wings服务器。
$ wcm publish --help Usage: wcm publish [OPTIONS][COMPONENT] Deploy the pacakge to the wcm. Options: -d, --debug / -nd, --no-debug -n, --dry-run --help Show this message and exit.
download
子命令将从当前wings服务器下载组件。
$ wcm download --help Usage: wcm download [OPTIONS] COMPONENT_ID Download a component from wings server. Data stored in .yaml file and source code downloaded to folder within same directory. file-path can be specified to download into a specific directory Options: -p, --profile <profile-name> -f, --file-path TEXT --help Show this message and exit.
list
子命令列出当前Wings服务器中所有组件的名称
$ wcm list --help Usage: wcm list [OPTIONS] Lists all the components in the current wings instance Options: -p, --profile <profile-name> --help Show this message and exit.
示例用法
一旦安装了wcm,请将您的凭据配置为使用wings服务器
C:\Users\Admin>wcm configure WINGS Server URL: WINGS Export URL: http://localhost:8080 WINGS User: myUsername WINGS Password: WINGS Domain: wings-domain Success
现在您可以开始使用wcm了。首先列出您在凭据上指定的wings实例上的组件
C:\Users\Admin>wcm list [Economic] └─┐ ├─ economic-v6 ├─ economictest-v5 ├─ economicnodata-v6 ├─ economic-different-data-v6 └─ economicwcmtest [Hydrological] └─┐ ├─ HAND-1 ├─ hand_final-v1 ├─ hand-v1 └─ handnodata-v1.0.1 Done
接下来,您可以下载其中一个组件。让我们选择经济型V6。首先,您需要导航到要将组件下载到的目录。或者,也可以使用-f<;filepath>;参数指定要下载到的组件的文件路径
C:\Users\Admin\Desktop\down>ls C:\Users\Admin\Desktop\down>wcm download economic-v5 2019-08-13 14:52:02,082 root INFO Downloading component 2019-08-13 14:52:02,226 root INFO Generated YAML 2019-08-13 14:52:02,256 root INFO Download complete Download complete C:\Users\Admin\Desktop\down>ls economic-v6
当你下载一个组件时,它有三个部分。存储组件数据的wings-component.yaml文件。存储排序代码的src文件夹。数据文件夹,目前只是一个占位符
下载economic-v5组件后,可以编辑一些源代码。要上载新版本(示例中为6.1),请使用publish命令
C:\Users\Admin\Desktop\down>ls economic-v6.1 C:\Users\Admin\Desktop\down>wcm publish economic-v6.1 2019-08-13 15:04:08,540 root INFO Publishing component Success
现在让我们检查list命令以确保它已发布
C:\Users\Admin\Desktop\down>wcm list [Economic] └─┐ ├─ economic-v6 ├─ economictest-v5 ├─ economicnodata-v6 ├─ economic-different-data-v6 ├─ economicwcmtest └─ economic-v6.1 [Hydrological] └─┐ ├─ HAND-1 ├─ hand_final-v1 ├─ hand-v1 └─ handnodata-v1.0.1 Done
现在,Economic-V6.1组件已上载到Wings