inetprocess/sugarcli

SugarCli is a command line tool to install and manage SugarCRM installations.

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

README

SugarCli is a command line tool to install and manage SugarCRM installations.

Install

Get the latest phar archive at https://github.com/inetprocess/sugarcli/blob/master/build/sugarcli.phar. Allow the execution and run it.

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

Or clone this git repository and use ./bin/sugarcli.

Build

Clone the git repository and run

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

It will build the sugarcli.phar Phar archive in the build folder.

Configuration

You can save some configurations options in different location. The latter one will override the previous one: /etc/sugarclirc $HOME/.sugarclirc ./.sugarclirc

Command line parameters will override these configurations.

Example

---
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
        - ...

Usage

  • ./sugarcli.phar list: List all commands available
  • ./sugarcli.phar namespace:command --help: Display help for a specific command

See the USAGE.md file for a complete list of commands and the associated help

Development

Run tests

Copy the file phpunit.xml.dist to phpunit.xml and edit the environment variables.

Run the full test suite with bin/phpunit or exclude groups to avoid required external resources bin/phpunit --exclude-group inventory,sugarcrm-db

Available groups:

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

Generate USAGE.md command documentation

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