Dashboard for triggering webhooks.
npm install strapi-plugin-deploy-dashboardbash
npm install strapi-plugin-deploy-dashboard
`
2. Enable the plugin in your Strapi project by adding it to your config/plugins.js file:
`javascript
module.exports = {
'strapi-plugin-deploy-dashboard': {
enabled: true,
},
};
`
---
Development
To contribute to the development of this plugin or customize it, follow these steps:
$3
1. Ensure the plugin is located in the plugins folder of your Strapi application.
2. Link the plugin source folder in your config/plugins.js file:
`javascript
export default () => ({
'strapi-plugin-deploy-dashboard': {
enabled: true,
resolve: './src/plugins/strapi-plugin-deploy-dashboard'
}
});
`
$3
The following commands are available to streamline the development process:
- Build: Builds the plugin for production.
`bash
npm run build
`
- Watch: Watches for changes in the plugin source code and rebuilds automatically.
`bash
npm run watch
`
Configuration
The plugin is configured through the config object in your Strapi project. Here's how to set it up:
$3
Add the following configuration to your config/plugins.js file:
`javascript
module.exports = {
'strapi-plugin-deploy-dashboard': {
config: {
deployments: [
{
name: "Main Application",
instances: [
{
id: "production",
name: "Production",
hookUrl: "https://example.com/webhook/deploy",
requestOptions: {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: {
branch: "main"
}
}
},
{
id: "staging",
name: "Staging",
hookUrl: "https://staging.example.com/webhook/deploy"
}
]
},
{
name: "Secondary Application",
instances: [
{
id: "development",
name: "Development",
hookUrl: "https://dev.example.com/webhook/deploy"
}
]
}
]
}
}
};
`
---
$3
| Property | Type | Description | Required |
|------------------------------|--------------|---------------------------------------------------------------------------------------|--------------|
| deployments | Array | A list of deployment configurations. Each deployment represents a group of instances. | Yes |
| deployments[].name | String | The name of the deployment group (e.g., "Main Application"). | Yes |
| deployments[].instances | Array | A list of instances within the deployment group. | Yes |
| instances[].id | String | A unique identifier for the instance (e.g., "production", "staging"). | Yes |
| instances[].name | String | A descriptive name for the instance (e.g., "Production"). | Yes |
| instances[].hookUrl | String (URL) | The URL of the webhook to trigger the deployment. | Yes |
| instances[].requestOptions | Object | Additional options for the request (e.g., headers, body, HTTP method). | No |
| requestOptions.method | String | HTTP method to use for the request (default: POST). | No |
| requestOptions.headers | Object | Headers to include with the request (e.g., Content-Type: application/json). | No |
| requestOptions.body | Object | The body payload to send with the request (used for POST, PUT, etc.). | No |
---
Example Configurations
$3
`javascript
{
name: "My Application",
instances
:
[
{
id: "prod",
name: "Production",
hookUrl: "https://example.com/webhook/deploy"
},
{
id: "dev",
name: "Development",
hookUrl: "https://dev.example.com/webhook/deploy"
}
]
}
`
$3
`javascript
{
name: "Advanced Application",
instances
:
[
{
id: "staging",
name: "Staging Environment",
hookUrl: "https://staging.example.com/webhook/deploy",
requestOptions: {
method: "POST",
headers: {
"Authorization": "Bearer my-secret-token",
"Content-Type": "application/json"
},
body: {
branch: "staging",
clearCache: true
}
}
}
]
}
`
---
Using the Plugin
1. Navigate to the Deploy Dashboard in the Strapi admin panel.
2. View the list of configured deployments and instances.
3. Trigger deployments by clicking the respective buttons for each instance.
---
Troubleshooting
- Invalid Webhook URL: Ensure that the hookUrl is correctly formatted and accessible.
- Authentication Issues: If the webhook requires authentication, include appropriate headers in the requestOptions`.