---
title: "Custom Deployment Script Configuration"
canonical: "https://docs.vaultspeed.com/space/VPD/4240507056/Custom%20Deployment%20Script%20Configuration"
format: markdown
---
**Table of Contents**

> Macro (toc)

### Custom Deployment Script Configuration

The `AGENT_CUSTOM_DEPLOY_SCRIPT` parameter in the `agent.properties` file is no longer supported. Custom deployment scripts must now be configured in the `connections.properties` file, consolidating all connection-related settings into a single location for easier management.

This page outlines how to define custom deployment scripts in the `connections.properties` file, with examples for configuring both single and multiple deployment scripts, offering greater flexibility in deployment setups.

### Steps to Configure Custom Deployment Scripts

1. **Locate or Create the **`connections.properties`** File**:  
The `connections.properties` file should be located in the same directory as your VaultSpeed agent. If it does not exist, create one manually in the agent’s root directory.
2. **Define Database Connections:**  
To define database connections, refer to the instructions on the "[Storing Connections](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3291381934)" page. Ensure `<dblinkname>` matches the database link defined in the VaultSpeed Cloud application.
3. **Add Custom Deployment Scripts**:  
Each defined connection should be treated as a separate entity with a single purpose, such as a Git connection, database connection, or custom deployment script.
  If a custom deployment script is needed, define a dedicated connection specifically for that script. For such connections, set the `.cmd` property using the format:  
`<connection_name>.cmd = <custom_script>`

> 📝 **Note:**
> 📝 
> 📝 This property does not need to be specified for every connection—only for those intended for custom deployment scripts.

### Example Configuration for Connections

Below is an example setup of a `connections.properties` file with four connections, where each connection serves a distinct purpose:

1. **For the Development (DEV) environment:**
  - **Database Connection**` (DEV_DB):`  
`DEV_DB.url = jdbc:postgresql://localhost:5432/postgres_DEV`
  - **Custom Deployment Script Connection**` (DEV_CMD):`  
`DEV_CMD.cmd = extract_dev_zip.sh`  
*(This script extracts the deployment ZIP file into a specific DEV directory.)*
2. **For the Quality Assurance (QA) environment:**
  - **Database Connection**` (QA_FB):`  
`QA_FB.url = jdbc:postgresql://localhost:5432/postgres_QA`
  - **Custom Deployment Script Connection**` (QA_CMD):`  
`QA_CMD.cmd = run_qa_deployment.sh`  
*(This script runs a shell command to handle deployment in the QA environment.)*

**Example Configuration:**

```
#jdbc urls (see vaultspeed documentation for format)
#for each database link, add the following: <dblinkname>.url = <url> where the dblinkname is the same as defined in the vaultspeed cloud app
#example: oracle_link1.url = jdbc:oracle:thin:username/password@localhost:1234:DB

# Connection towards DEV database
DEV_DB.url=jdbc:postgresql://localhost:5432/postgres_DEV?user=devusername&password=

#Connection for DEV using custom Deploy script
DEV_CMD.cmd = unzip {zipname} /path/to/DEV/directory

#Connection for QA database
QA_DB.url=jdbc:postgresql://localhost:5432/postgres_TEST?user=devusername&password=

#Connection for QA using custom Deploy script
QA_CMD.cmd = sh /home/agent/deploy.sh {zipname}
```

### Using Multiple Custom Deployment Scripts

VaultSpeed now supports multiple custom deployment scripts, allowing you to define separate deployment scripts for different environments. This feature enhances flexibility by letting you choose the appropriate script at deployment time.

#### 1. Configure Each Script as a Separate Connection

To use multiple custom deployment scripts, define each script as a separate connection in the `connections.properties` file. Each connection should have a unique name and its own deployment script.

```
#jdbc urls (see vaultspeed documentation for format)
#for each database link, add the following: <dblinkname>.url = <url> where the dblinkname is the same as defined in the vaultspeed cloud app
#example: oracle_link1.url = jdbc:oracle:thin:username/password@localhost:1234:DB

# First custom deployment script
DEV_CMD.cmd = unzip {zipname} /path/to/DEV/directory

#Second custom deployment script
QA_CMD.cmd = sh /home/agent/deploy.sh {zipname}
```

You can configure as many database connections and custom deployment scripts as needed, but each connection must have a unique name.

#### **2. Select the Right Script During Deployment**

Once the connections are defined, select the appropriate script during deployment:

1. **Go to the Automatic Deployment menu** in the VaultSpeed UI.
2. Select the generated code you want to deploy.
3. Click on the **"Deploy"** action. *(Refer to the screenshot below where the "Deploy" action is highlighted.)*

![thumbnail_image012.png](media://51ba403f-b684-4211-becb-fc7d1e478026)

4. In the deployment options, navigate to the **"Custom Script"** section.
5. Enter the connection name corresponding to the script you want to use (`DEV_CMD` for the DEV script, `QA_CMD` for the QA script, etc.).
6. Click **Deploy** to execute the selected script.

![thumbnail_image013_.png](media://be7bc9c6-b505-48a7-925b-303da5fba752)

For example, if you want to use the **DEV deployment script**, enter `DEV_CMD`. For the **QA deployment script**, enter `QA_CMD`.

![thumbnail_image001.png](media://7b0a723a-60e7-489f-9962-5d83e21791f3)

> 📝 **Key Points to Remember**
> 📝 
> 📝 - Each custom deployment script must be defined as a separate connection in `connections.properties`.
> 📝 - The connection name acts as the identifier for selecting the script at deployment time.
> 📝 - There is no limit to the number of deployment script connections you can define.
> 📝 - Ensure that the VaultSpeed agent has the necessary permissions to execute the scripts.

### Guidelines for Configuration

1. **Database Connection URLs**:  
Use the appropriate JDBC URL format for your database. For example:
  - Oracle databases: `jdbc:oracle:thin:username/password@localhost:1234:DB`

Refer to **VaultSpeed’s ****[Defining a Source](https://docs.vaultspeed.com/space/VPD/3012722714/Source+Connection+Details)** documentation for more URL examples and formatting details.

2. **Matching Database Links**:  
Ensure that `<dblinkname>` in the `connections.properties` file matches the database link name configured in the VaultSpeed Cloud application.
3. **Custom Deployment Scripts**:
  - Deployment scripts must be platform-specific. For example:
    - Use `unzip` for extracting files on Unix/Linux.
    - Use `sh` for executing shell scripts.
4. **Agent Permissions**:  
Ensure the VaultSpeed agent has the necessary permissions to execute the defined commands.

> 📝 ### Migration Reminder
> 📝 
> 📝 If you previously used the `AGENT_CUSTOM_DEPLOY_SCRIPT` parameter in the `agent.properties` file, you must migrate your configurations to the `connections.properties` file. Deployment script definitions are no longer supported in the `agent.properties` file.

#### **Next Steps**

1. Update the `connections.properties` file for your VaultSpeed agent based on the examples provided above.
2. Test your deployment scripts to ensure they function as expected.
3. For further details, refer to the [VaultSpeed Agent Documentation](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3012821038).