Create the artifact deployment script
  • 06 Nov 2024
  • 4 Minutes to read
  • Dark
    Light

Create the artifact deployment script

  • Dark
    Light

Article summary

Learn how to manually create the artifact deployment script. This script lists the artifacts you want to deploy into a ZOrg through Zilliant CLI.

To create the deployment script automatically, run the project:deploy:script:generate command.

Before you begin

Use Zilliant CLI to deploy up to 10,000 rows of entity data. For bigger entities, use data migration tools such as Zilliant's Entity Import service or Entity Export service .

Script structure

Use the following structure for an artifact deployment script:

{
    "artifacts": {
        "action": "",
        "entities": [
        ],
        "views": [
        ],
        "folders": [
        ],
        "workbooks": [
        ],
        "worksheets": [
        ],
        "dram": [
        ],
        "workflows": [
        ],
        "notebooks": [
        ]
    },
    "data": [
    ]
}

While creating the script, consider the following:

  • Use the action parameter to indicate the operation to perform with artifacts that you are deploying.

  • For folders, workbooks, and worksheets, use their system IDs as their names in the script.

    Tip
    • To find a workbook ID
      In Price Manager, open a workbook, select Properties > Workbook properties, and locate the Workbook Id field.
    • To find a worksheet ID
      In Price Manager, open a worksheet, select Properties > General properties, and locate the Worksheet Id field.
  • For all other artifact types, except for folders, workbooks, and worksheets, use their names as they appear in the Price Manager application.

  • Use a wildcard or deployAll parameter to deploy all artifacts of a specific type.

action parameter

The action parameter specifies the operation to perform with artifacts that you are deploying. You can set it at the parent level to apply to all artifacts or at the level of separate artifacts. An action specified for a specific artifact overrides the parent-level action.

Supported values of the action parameter:

  • Create—Create and deploy the artifacts in your ZOrg.
  • Delete_then_create—Delete the artifacts if they are already deployed in your ZOrg, then recreate them using information from the deployment script.
    Important

    If you are deploying entity artifacts, the Delete_then_create action deletes all data in the ZOrg because the underlying table is removed and recreated.

  • Delete—Delete the artifacts if they are already deployed in your ZOrg. You can use this action even for artifacts that are not present in the project on your computer.
  • Upsert—Update the artifacts. Returns an error if an artifact isn't already deployed. The Upsert action is supported only for entities and worksheets.
  • Upsert_with_entity_field_removal—Update entities and delete from the target entity the fields that are not included in the entity definition in the bundle. The Upsert_with_entity_field_removal action is supported only for entities.
Use example of the action parameter at different levels
{ 
    "artifacts": { 
        "action": "Create",  // Parent level action 
        "entities": { 
            "action": "Delete_then_create", // Action at the artifact group level, overrides the parent level action 
            "Product": { 
                "action": "Delete" // Artifact level action, overrides action at the artifact group level 
            }, 
            "Cost": { 
                "action": "Delete_then_create" // Artifact level action, overrides action at the artifact group level 
            }, 
            "Price": "*" // No action at this level, the entity will inherit the action at the artifact group level 
        }, 
        "views": { 
            "action": "Delete_then_create", // Action at the artifact group level, overrides the parent level action 
            "Product_View_0001": { 
                "action": "Delete" // Overrides the parent level action 
            } 
        } 
    } 
} 
    

Wildcard

Use the * wildcard character to deploy all artifacts of a type that inherits the parent level action.

In the example below, the * wildcard indicates that all artifacts of the entity, view, and folder types should be deployed using the Create action.

    {
        "artifacts": {
            "action": "Create", // Parent level action
            "entities": "*",
            "views": "*",
            "folders": "*"
        },
    }

You can't use the * wildcard for artifact types that have additional key-value pairs in the script, for example, artifact types with an action that overrides the parent level action. In such cases, use the deployAll parameter instead.

deployAll parameter

Use the "deployAll": true key-value pair as a wildcard to deploy all artifacts of a specific type. You can use this parameter to deploy:

  • Artifact types that have additional key-value pairs in the script, for example, artifact types with an action that overrides the parent level action.
  • Entity data.
Note

You can't use the deployAll parameter as a global wildcard above the artifact types.

In the example below, the deployAll parameter indicates that all artifacts of the entity type should be deployed. Here, we use the deployAll parameter because we specified the Upsert action at the level of the entity artifact group to override the parent level action.

{
    "artifacts": {
        "action": "Delete_then_create", // Parent level action
        "entities": {
            "action": "Upsert", // Action at the artifact group level
            "deployAll": true,  // Indicates that all entities should be deployed using the upsert action
            "Product": {
                "action": "Create" // Artifact level action, overrides the action at the artifact group level
            }
        }
    },
    "data": {
        "action": "Create",
        "deployAll": true // Indicates that all entity data should be deployed
    }
}

Dependency resolution

All artifact dependencies are assumed to be in the target ZOrg or listed in the manifest. If any dependencies are missing, deployment fails without deploying any artifacts.

Deployment order

All sprocs are deployed in the order you list them in the script. To prevent deployment failures, make sure you list all sprocs dependencies in the correct order.

For other artifact types, the proper deployment sequence is determined automatically. This prevents failures that result from artifacts being deployed before their dependencies.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.