### Basic Usage Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Starts the deployment manager CLI tool. The tool can be invoked from any directory after installation and PATH configuration. ```bash prd2 ``` -------------------------------- ### Install Latest Deployment Manager (Windows) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Installs the latest version of the deployment manager on Windows using PowerShell to fetch the release URL and pip to install. ```powershell $LatestURL = (Invoke-RestMethod -Uri "https://api.github.com/repos/rossumai/deployment-manager/releases/latest").assets | Where-Object { $_.name -like "*.whl" } | Select-Object -ExpandProperty browser_download_url pip install $LatestURL ``` -------------------------------- ### PRD Configuration Example (prd_config.yaml) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md An example of the prd_config.yaml file, which defines the directory structure for Rossum organizations, including API base URLs and subdirectories for different environments. ```YAML directories: sandbox-org: org_id: '251437' api_base: https://rdttest.rossum.app/api/v1 subdirectories: dev: regex: '' uat: regex: '' prod-org: org_id: '255590' api_base: https://rdttest.rossum.app/api/v1 subdirectories: prod: regex: '' ``` -------------------------------- ### Install Specific Version (Linux/MacOS) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Installs a specific version of the deployment manager by providing the direct download URL for the .whl file. ```bash pip install https://github.com/rossumai/deployment-manager/releases/download/v2.7.0a/deployment_manager-2.7.0-py3-none-any.whl ``` -------------------------------- ### Install Specific Version (Windows) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Installs a specific version of the deployment manager on Windows by providing the direct download URL for the .whl file. ```powershell pip install https://github.com/rossumai/deployment-manager/releases/v2.0.1/download/deployment_manager-latest-py3-none-any.whl ``` -------------------------------- ### Project Directory Structure Example Source: https://github.com/rossumai/deployment-manager/blob/main/README.md A visual representation of a typical project directory structure managed by PRD, showing organizations, subdirectories, workspaces, queues, and configuration files. ```JSON ├── prd_config.yaml ├── prod-org │ ├── credentials.yaml │ ├── organization.json │ └── prod │ ├── hooks │ │ └── Master Data Hub 1 - DEV_[521877].json │ └── workspaces │ └── AP_[572556] │ ├── queues │ │ └── Invoices_[1509387] │ │ ├── formulas │ │ │ └── some_formula.py │ │ ├── rules │ │ │ └── some_rule.py │ │ ├── email_templates │ │ │ └── some_email_template.py │ │ ├── inbox.json │ │ ├── queue.json │ │ └── schema.json │ └── workspace.json └── sandbox-org ├── credentials.yaml ├── dev │ └── workspaces │ └── AP_[521887] │ ├── queues │ │ └── Invoices_[1230128] │ │ ├── inbox.json │ │ ├── queue.json │ │ └── schema.json │ └── workspace.json ├── organization.json └── uat └── workspaces └── AP_[563305] ├── queues │ └── Invoices_[1462491] │ ├── inbox.json │ ├── queue.json │ └── schema.json └── workspace.json ``` -------------------------------- ### Install via Virtual Environment (Linux/MacOS) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Installs the deployment manager within a Python virtual environment and adds its bin directory to the system's PATH. This method is useful if direct pip installation fails. ```bash mkdir .deployment-manager-venv cd deployment-manager-venv python3 -m venv . source bin/activate pip install $(curl -s https://api.github.com/repos/rossumai/deployment-manager/releases/latest | jq -r '.assets[].browser_download_url' | grep '.whl') nano ~/.zshrc # Add this to the end of the file export PATH="$PATH:$HOME/.deployment-manager-venv/bin" # After saving, restart via the following command: source ~/.zshrc ``` -------------------------------- ### Get Help Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Displays the help message for the deployment manager CLI tool, providing an overview of all available parameters and options. This command can also be used for subcommands. ```bash prd2 --help ``` -------------------------------- ### Install Latest Deployment Manager (Linux/MacOS) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Installs the latest version of the deployment manager using pip and a curl command to fetch the latest release URL. Requires jq to parse JSON output from the GitHub API. ```bash pip install $(curl -s https://api.github.com/repos/rossumai/deployment-manager/releases/latest | jq -r '.assets[].browser_download_url' | grep '.whl') ``` -------------------------------- ### Attribute Override Examples Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Provides examples of overriding attributes in target objects using JMESPath queries. It demonstrates overriding a specific attribute within an object and overriding an entire object. ```YAML attribute_override: metadata.som: 'second' ``` ```YAML attribute_override: metadata: som: 'second' ``` -------------------------------- ### Update Deployment Manager Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Updates the deployment manager to the latest version by simply re-running the installation command. Pip handles the uninstallation of the older version and installation of the new one. ```bash pip install $(curl -s https://api.github.com/repos/rossumai/deployment-manager/releases/latest | jq -r '.assets[].browser_download_url' | grep '.whl') ``` -------------------------------- ### Purge Command Usage Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Describes the `purge` command for removing objects from a specific organization. It covers specifying object types, using local configurations or remote credentials, and the confirmation process before deletion. Includes an example for deleting unused schemas. ```bash prd2 purge unused_schemas prd2 purge hooks prd2 purge all ``` -------------------------------- ### Initialize New Rossum Project Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Initializes a new project with the specified name. Requires at least one org-level directory and one subdirectory. Sets up an empty Git repository and configures credentials. ```bash prd2 init ``` -------------------------------- ### Login to Rossum API Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Authenticates with the Rossum API to generate an access token. Requires username and password. ```bash curl --location 'https://rdttest.rossum.app/api/v1/auth/login' \ --header 'Content-Type: application/json' \ --data '{ "username": "my-user", "password": "my-password" }' ``` -------------------------------- ### Rossum API Authentication and Object Management Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Provides an overview of interacting with the Rossum API for authentication and managing project objects. Includes endpoints for login and general API usage. ```APIDOC OpenAPI Specification for Rossum API: Base URL: https:///api/v1 Endpoints: 1. **Login Endpoint** * **URL**: `/auth/login` * **Method**: `POST` * **Description**: Authenticates a user and returns an access token. * **Request Body**: ```json { "username": "string", "password": "string" } ``` * **Success Response**: ```json { "token": "string" } ``` * **Error Responses**: - `401 Unauthorized`: Invalid credentials. 2. **Object Pulling** * **Method**: `GET` (Conceptual, handled by `prd2 pull` CLI command) * **Description**: Retrieves objects from Rossum for a given directory. The CLI command `prd2 pull ` handles the interaction with the Rossum API to fetch objects. * **Parameters**: - `DIR-NAME`: The name of the directory in the project to pull objects for. * **Pre-condition**: Local objects should not have uncommitted changes. 3. **Object Pushing** * **Method**: `PUT` or `POST` (Conceptual, handled by `prd2 push` CLI command) * **Description**: Uploads local changes to Rossum. The CLI command `prd2 push ` manages this process. * **Parameters**: - `DIR-NAME`: The name of the directory containing the changes to push. - `--force`: Optional flag to override the `last_modified` timestamp check. * **Pre-condition**: Checks `last_modified` timestamp on remote objects. Local deletions are not supported via `push`. 4. **Deployment Operations** * **Method**: `POST` (Conceptual, handled by `prd2 deploy run` CLI command) * **Description**: Deploys configurations based on a deploy file. Involves a planning phase and an execution phase. * **Parameters**: - ``: Path to the deploy file. * **Process**: 1. **Template Generation**: `prd2 deploy template` creates a deploy file. 2. **Template Update**: `prd2 deploy template -f --interactive` updates an existing deploy file. 3. **Execution**: `prd2 deploy run ` executes the deployment. * **Error Handling**: Errors during planning abort the deploy. Errors during execution are logged, and deployment stops. * **Output**: Deploy file is updated with IDs of newly created objects. ``` -------------------------------- ### Create Deploy Template Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Generates a deploy template file to specify which configurations should be copied or deployed. Allows for attribute overrides and defining targets for deployment. ```bash prd2 deploy template ``` -------------------------------- ### Run Deployment Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Executes a deployment based on a specified deploy file. Shows a plan of changes and prompts for confirmation before applying them. Handles errors during planning and execution. ```bash prd2 deploy run ``` -------------------------------- ### YAML Configuration for Multiple Targets Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Demonstrates how to configure a workspace to be deployed to multiple target objects, including separate attribute overrides for each target. ```YAML workspaces: - id: 521887 name: WS1 DEV targets: - id: attribute_override: name: WS1 UAT - id: attribute_override: name: WS1 PROD ``` -------------------------------- ### Queue Configuration Flags Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Demonstrates the usage of optional flags for queue configurations within deploy files. These flags control the retention of hook dependencies and the display of deployment warnings. ```YAML queue.keep_hook_dependencies_without_equivalent: true queue.ignore_deploy_warnings: true ``` -------------------------------- ### Creating a Hook Payload Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Command to generate a payload for a local hook path. Optionally accepts an annotation URL. ```Shell prd2 hook payload [ -au ] ``` -------------------------------- ### Testing a Hook Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Command to test a hook by running it with a payload and displaying logs. Allows specifying a payload path and annotation URL. ```Shell prd2 hook payload [-pp -au ] ``` -------------------------------- ### Credential Management Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Outlines the order in which PRD commands attempt to find and use credentials: from `credentials.yaml`, by asking the user and saving, or by asking for a token without saving. It also notes commands like `purge` that may ask for credentials every time. ```APIDOC Credential Management: Order of precedence: 1. `credentials.yaml` (org-level directory). 2. Prompt user for valid credentials if invalid, save for future use. 3. Prompt user for token without saving if no credentials exist. - Commands like `purge` may prompt for credentials each time. ``` -------------------------------- ### Push Command Usage Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Details the `push` command, focusing on its interaction with GIT for selective pushes using `git add` and the `-io` or `--indexed-only` flags. It also covers automatic committing with `-c` or `-cm` flags. ```bash git add prd2 push prd2 push -io prd2 push --indexed-only prd2 push -c prd2 push -cm "Commit message" ``` -------------------------------- ### Deploy Command - Attribute Ignoring Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Explains that for cross-organization deployments, certain configuration parts like approval workflows and engines are ignored because they are not writable via the API. ```APIDOC Deploy Command: - Ignores non-writable attributes for cross-org deploys (e.g., approval workflows, engines). ``` -------------------------------- ### Pull Objects from Rossum Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Downloads objects from Rossum to the local repository for a specified directory. Checks for uncommitted local changes before pulling. ```bash cd prd2 pull ``` -------------------------------- ### Update Deploy Template Interactively Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Updates an existing deploy template file interactively. Allows for fixing names based on object IDs, adding hooks, and managing specified objects in the deploy file. ```bash prd2 deploy template -f --interactive ``` -------------------------------- ### Push Local Changes to Rossum Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Uploads local changes made in a specified directory back to Rossum. Includes a check for remote object modification timestamps, with an option to force push. ```bash prd2 push ``` -------------------------------- ### Add Deployment Manager to PATH (Windows) Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Adds the deployment manager executable to the system's PATH environment variable on Windows using a PowerShell script. This allows the tool to be run from any directory. ```powershell powershell -ExecutionPolicy Bypass -Command "& {Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/rossumai/deployment-manager/main/add_to_path.ps1' -OutFile add_to_path.ps1; & ./add_to_path.ps1}" ``` -------------------------------- ### PRD Push Command - GIT Changes Check Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Details how the PRD `push` command leverages GIT to identify locally changed objects for pushing. It explains the `--all` or `-a` option to push all local objects regardless of GIT change status. ```APIDOC PRD Push Command (GIT Check): - Uses GIT to determine which local objects have changed. - Pushes only changed objects by default. - Use `--all` or `-a` to push all local objects, irrespective of GIT changes. ``` -------------------------------- ### Attribute Override with Regex Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Illustrates how to use regular expressions within attribute overrides to replace specific parts of a value in deploy files. It shows the use of a separator for regex and static values, and the need to escape special regex characters. ```YAML workspaces: - id: 538437 name: Invoices US targets: - id: attribute_override: name: \bUS\b/#/EU ``` ```YAML workspaces: - id: 538437 name: Invoices (US) targets: - id: attribute_override: name: \(US\)/#/(EU) ``` -------------------------------- ### Deploy Command - Automatic ID Override Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Details the two methods PRD uses for automatic ID replacement during deployment: replacing IDs in known attributes (like `queue.hooks`) and handling edge cases for single IDs, lists of IDs, and multiple target equivalents. ```APIDOC Deploy Command - Automatic ID Override: 1. Replacing IDs in known attributes (e.g., `queue.hooks`): - IDs of dependencies are automatically replaced. - Edge Cases: - Single ID, no target equivalent: Keeps dependency, shows warning. - List of IDs, one missing target: Ignores missing dependency, applies others. - Multiple target equivalents: Assigns based on index if sibling count matches, otherwise uses the first. - Dangling dependencies in target object are maintained. ``` -------------------------------- ### Pull Command Usage Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Explains the `pull` command's functionality, including its use of GIT to prevent overwriting local changes and its commit expectations. It also details how `pull` determines where to save remote objects locally. ```bash prd2 pull prd2 pull -c prd2 pull -cm "Commit message" ``` -------------------------------- ### PRD Pull Command - Timestamp Check Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Describes how the PRD `pull` command uses the `modified_at` timestamp to download only changed objects. It highlights the assumption that unequal timestamps indicate remote changes and the `--all` or `-a` option to pull all objects. ```APIDOC PRD Pull Command: - Utilizes `modified_at` timestamp to compare local and remote objects. - Downloads only objects that have changed remotely (assumed when timestamps are unequal). - Override behavior with `--all` or `-a` to pull all objects. ``` -------------------------------- ### Ignored Attributes for Pull/Push Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Lists attributes that are ignored by the `pull` and `push` commands, meaning they are neither pulled from nor pushed to the remote. ```APIDOC Ignored Attributes (Pull/Push): - Queue: ["counts", "users"] - Hook: ["status"] ``` -------------------------------- ### PRD Push Command - Timestamp Check Source: https://github.com/rossumai/deployment-manager/blob/main/README.md Explains how the PRD `push` command uses the `modified_at` timestamp to prevent overwriting remote changes. It also details the `--force` or `-f` option to override this behavior. ```APIDOC PRD Push Command: - Analyzes `modified_at` timestamp on remote API objects. - Compares remote timestamp with local JSON object. - Skips objects if remote timestamp differs from local to prevent overwriting. - Override behavior with `--force` or `-f` to push local objects. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.