Flight Plans
Flight Plans are used to execute multiple Commands in series. This allows building flexible condition-based execution flows.
Access Rules
Group | Action | Condition |
---|---|---|
User | R | Access level is "User" and the user is added in "Users" |
User | R | Access level is "User" and the user is added in "Users" in related Servers |
Manager | R | Access level is "Manager" or less and the record is not connected to any Server |
Manager | R | Access level is "Manager" or less and the user is added in "Users" or "Managers" |
Manager | R | Access level is "Manager" or less and the user is added in "Users" or "Managers" in related Servers |
Manager | CRU | Access level is "Manager" or less and the user is added in "Managers" |
Manager | CRUD | Access level is "Manager" or less and the record is created by the user and the user is added in "Managers" |
Root | CRUD | Any record |
Info
CRUD stands for Create, Read, Update, Delete.
Flight Plan Configuration
Flight Plans are located under the Cetmix Tower > Commands > Flight Plans
menu.
Fields
Field | Description |
---|---|
Name | Flight Plan name. |
Reference | Used for Odoo automation and YAML export/import. Leave blank to generate it automatically. |
Allow Parallel Run | If disabled, only one copy of this Flight Plan can be run on the same server at the same time. Otherwise, the same command can be run in parallel. |
On Error | Default action to execute when an error happens during the Flight Plan run. |
Note | Comments or user notes. |
Servers | List of Servers this command can be run on. Leave this field blank to make the command available to all servers. |
Tags | User-defined search tags for filtering and searching. |
Access Level | Minimum access level required to run this Flight Plan. |
Notebook Tabs
Tab | Description |
---|---|
Code | List of Flight Plan Lines to execute. |
Access | Access Roles for this record for specific users. |
YAML | This tab is visible only to users with "Cetmix Tower YAML > Export" setting enabled. Please refer to the Cetmix Tower YAML documentation for more details. |
Flight Plan Lines
Defines the Flight Plan Line command and its execution conditions.
Field | Description |
---|---|
Sequence | Order this command is executed. Lower value = higher priority. |
Reference | Used for Odoo automation and YAML export/import. Leave blank to generate it automatically. |
Command | Command to be executed. |
Use Sudo | Use sudo if required to run this command. |
Path | Specify path where command will be executed. Overrides Default Path of the command. This field supports Variables. |
Condition | Python expression to be matched for the command to be executed. Leave this field blank for unconditional command execution. This field supports Variables. |
Tab | Description |
---|---|
Command Preview | Preview of the command to be executed. |
Post Run Actions | List of conditional actions to be triggered after the command is executed. |
Flight Plan Line condition example:
{{ odoo_version }} == "17.0" and ( {{ nginx_installed }} or {{ traefik_installed }} )
Post Run Actions
List of actions to be triggered after the command is executed.
Details of the action including variables to be updated.
Field | Description |
---|---|
Sequence | Order this action is triggered. Lower value = higher priority. |
If exit code | Condition that is checked. |
Action | Action to execute if condition is met. |
Variables | Configuration Variables to be updated or added to the Server. |
On Error Actions
Possible actions to execute when an error happens during the Flight Plan run:
Action | Description |
---|---|
Exit with command code | Will terminate the Flight Plan execution and return an exit code of the failed command. |
Exit with custom code | Will terminate the Flight Plan execution and return the custom code configured in the field next to this one. |
Run next command | Will continue Flight Plan execution. |
YAML Format Specification
Flight Plan
cetmix_tower_model: plan
access_level: manager
reference: build_odoo_image_from_cetmix_dockerfile
name: Build Odoo base image
allow_parallel_run: false # Boolean. If disabled, only one copy of this Flight Plan can be run on the same server at the same time. Otherwise, the same command can be run in parallel.
color: 0 # Integer. Possible values: 0-10. Color for better visualization in views.
tag_ids: # List of Tag references or Tag objects.
- odoo # Tag reference or a Tag object.
- docker # Tag reference or a Tag object.
note: Builds a core Odoo image using Cetmix Dockerfile designed for Tower
on_error_action: e # String. Possible values: "e", "Exit with command exit code", "ec", "Exit with custom exit code", "n", "Run next command".
custom_exit_code: 0 # Integer. Custom exit code to be returned if the condition is met.
line_ids: # List of Flight Plan Line references or Flight Plan Line objects.
- create_temporary_directory_for_odoo_dockerfile_2 # Flight Plan Line reference or a Flight Plan Line object.
- fetch_cetmix_official_dockerfile # Flight Plan Line reference or a Flight Plan Line object.
- build_image_using_cetmix_official_dockerfile # Flight Plan Line reference or a Flight Plan Line object.
- remove_temporary_directory_for_odoo_dockerfile_2 # Flight Plan Line reference or a Flight Plan Line object.
- build_odoo_image_from_cetmix_dockerfile_plan_line_1 # Flight Plan Line reference or a Flight Plan Line object.
Flight Plan Line
reference: create_temporary_directory_for_odoo_dockerfile_2
sequence: 10 # Integer. Sequence number for sorting. Lower number means higher position in the list.
condition: "{{ build_type }} == 'prod'" # Python expression. Condition to be matched for the command to be executed.
use_sudo: false # Boolean. If true, the command will be executed with sudo.
path: false # String. Path to execute the command.
command_id: create_temporary_directory_for_odoo_dockerfile # Command reference or a Command object.
action_ids: # List of Post Run Action references or Post Run Action objects.
- if_exit_code__0_then_run_next_command_30 # Post Run Action reference or a Post Run Action object.
- if_exit_code__1_then_exit_with_custom_code_34 # Post Run Action reference or a Post Run Action object.
variable_ids: # List of Variable references or Variable objects. Variables used in the condition.
- build_type # Variable reference or a Variable object.
Post Run Action
reference: if_exit_code__0_then_run_next_command_30
sequence: 10 # Integer. Sequence number for sorting. Lower number means higher position in the list.
condition: '!=' # String. Condition to be matched for the action to be executed. Possible values: ==, !=, >, >=, <, <=.
value_char: '0' # String. Value to be matched.
action: n # String. Action to be executed. Possible values: "e", "Exit with command exit code", "ec", "Exit with custom exit code", "n", "Run next command".
custom_exit_code: 0 # Integer. Custom exit code to be returned if the condition is met.
variable_value_ids: # List of Variable Value references or Variable Value objects. Values to be set in the Server.
- core_image_build_failed_variable_value_1 # Variable Value reference or a Variable Value object.
Note
Flight Plan Lines and Post Run Actions are always exported as a part of the Flight Plan they belong to.
Please refer to the General YAML Format Specification for more details.