Skip to content
Content only available in english

cob-cli updateFromServer command

cob-cli updateFromServer [--servername <servername>] [--code]

This command has two distinct modes of operation depending on whether the --code flag is used.

Default (data export): Exports data and configuration from the server into the local others/solutionsData/ directory. The data to export is driven by solutions.yml. This is the most common usage.

With --code: Copies the server's live code files into the local repository. This is intended for cases where changes were made directly on the server outside of the standard cob-cli process, and is not expected to be needed frequently.

Data Export (default)

When run without --code, cob-cli updateFromServer authenticates against the server and exports the data types configured in solutions.yml for each solution. Any previously exported data in others/solutionsData/ is cleared before the new export begins.

Authentication

The command will prompt for a username and password. Alternatively, a cookie file can be provided via --cookie <path>.

Exported data

For each solution defined in solutions.yml, the following data types are exported into others/solutionsData/<solution_name>/:

Data typeConfig keyOutput
RecordM domainsdomainsdomains/<name>.json
Record definitionsdefinitionsdefinitions/<name>.json, views/<name>.jsonl
Data records (instances)instancesinstances/<name>.xlsx
Groups and permissionspermissionspermissions.json
Kibana saved objectskibanakibana/<space>.ndjson

An _index file is created at the root of others/solutionsData/ listing all exported solution names.

Code Update (--code)

When run with --code, the command copies files from the server's live directories into the local repository. It will only change files that differ from the server and will report what changed.

Note: After running updateFromServer --code, any local changes since the last deploy may be overwritten. A cob-cli deploy --force will be required on the next deploy.

Consistency Checks

Before copying files, the following checks are performed:

Checking conditions to update cob-cli files from <server_name>.cultofbits.com
  Check connectivity and permissions
  Check there's no cob-cli test' running
  Check git status
  1. Check connectivity and permissions — Verifies the user has permission to connect to the server.
  2. Check there's no cob-cli test' running — Ensures no tests are running on the server, which would produce temporary files that should not be copied locally.
  3. Check git status — Ensures the local working tree is clean (no uncommitted or unstashed changes, and not behind origin).

Options

-s --servername <servername>
        Specify the name of the CoB server (without the FQDN).

-e --environment <env_name>
        Name of the target environment.

-c --code
        Update code files from the server instead of exporting data.

--cookie <path>
        Path to a cookie file to use for authentication (data export mode only).

-V --verbose
        Verbose execution output. Can be repeated for increased verbosity (e.g. -VVV).