inetprocess/sugarcli

SugarCli 是一个命令行工具,用于安装和管理 SugarCRM 安装。

v1.20.0 2023-06-14 10:30 UTC

README

SugarCli 是一个命令行工具,用于安装和管理 SugarCRM 安装。

安装

https://github.com/inetprocess/sugarcli/blob/master/build/sugarcli.phar 获取最新的 phar 归档。允许执行并运行它。

cd /usr/local/bin/
wget 'https://github.com/inetprocess/sugarcli/releases/download/v1.20.0/sugarcli.phar'
chmod +x ./sugarcli.phar
mv sugarcli.phar sugarcli
sugarcli help

或者克隆此 Git 仓库并使用 ./bin/sugarcli

构建

克隆 Git 仓库并运行

composer install --no-dev --quiet -o
mkdir build
ulimit -Sn 4096
php -dphar.readonly=0 bin/box build

它将在 build 文件夹中构建 sugarcli.phar Phar 归档。

配置

您可以在不同的位置保存一些配置选项。后者将覆盖前者:/etc/sugarclirc $HOME/.sugarclirc ./.sugarclirc

命令行参数将覆盖这些配置。

示例

---
sugarcrm:
    path: PATH              #Path to Sugarcrm relative to the configuration file
    user_id: USER_ID        #SugarCRM user id to impersonate when running the command
metadata:
    file: FILE              #Path to the metadata file relative to the configuration file
account:
    name: ACCOUNT_NAME      #Name of the account
backup:
    prefix: PREFIX          #Prefix to prepend to name of archive file when creating backups
maintenance:
    page: FILE or CONTENT   #File name or content of maintenance page
    allowed_ips:            #List of ips allowed to by-pass the maintenance page
        - IP1
        - IP2
        - ...

用法

  • ./sugarcli.phar list:列出所有可用的命令
  • ./sugarcli.phar namespace:command --help:显示特定命令的帮助信息

请参阅USAGE.md 文件以获取所有命令和相关的帮助信息

开发

运行测试

将文件 phpunit.xml.dist 复制到 phpunit.xml 并编辑环境变量。

使用 bin/phpunit 运行完整的测试套件,或排除组以避免所需的资源 bin/phpunit --exclude-group inventory,sugarcrm-db

可用的组:

  • inventory
  • sugarcrm-db
  • sugarcrm-path
  • sugarcrm-url

生成 USAGE.md 命令文档

bin/sugarcli list --format json | php bin/format_help.php  >| USAGE.md