Strapi plugin logo for Deployment Dashboard

Deployment Dashboard

Dashboard that lets you define which web hooks / endpoints you want to trigger or send request to.

strapi-plugin-deploy-dashboard

A Strapi plugin that allows you to manage deployment webhooks directly from a dashboard. Configure your deployment endpoints, trigger builds, and manage multiple environments with ease.

Check it out on npm npm


Features

  • Define deployment configurations in your project settings.
  • Support for multiple deployment environments and instances.
  • Advanced request options for fine-tuned webhook control.
  • User-friendly dashboard for triggering deployments.

Installation

  1. Install the plugin:

    npm install strapi-plugin-deploy-dashboard
  2. Enable the plugin in your Strapi project by adding it to your config/plugins.js file:

    1module.exports = {
    2  'strapi-plugin-deploy-dashboard': {
    3    enabled: true,
    4  },
    5};

Development

To contribute to the development of this plugin or customize it, follow these steps:

Setup

  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:
    1export default () => ({
    2    'strapi-plugin-deploy-dashboard': {
    3        enabled: true,
    4        resolve: './src/plugins/strapi-plugin-deploy-dashboard'
    5    }
    6});

Development Commands

The following commands are available to streamline the development process:

  • Build: Builds the plugin for production.
    npm run build
  • Watch: Watches for changes in the plugin source code and rebuilds automatically.
    npm run watch

Configuration

The plugin is configured through the config object in your Strapi project. Here's how to set it up:

Example Configuration

Add the following configuration to your config/plugins.js file:

1module.exports = {
2  'strapi-plugin-deploy-dashboard': {
3    config: {
4      deployments: [
5        {
6          name: "Main Application",
7          instances: [
8            {
9              id: "production",
10              name: "Production",
11              hookUrl: "https://example.com/webhook/deploy",
12              requestOptions: {
13                method: "POST",
14                headers: {
15                  "Content-Type": "application/json"
16                },
17                body: {
18                  branch: "main"
19                }
20              }
21            },
22            {
23              id: "staging",
24              name: "Staging",
25              hookUrl: "https://staging.example.com/webhook/deploy"
26            }
27          ]
28        },
29        {
30          name: "Secondary Application",
31          instances: [
32            {
33              id: "development",
34              name: "Development",
35              hookUrl: "https://dev.example.com/webhook/deploy"
36            }
37          ]
38        }
39      ]
40    }
41  }
42};

Configuration Structure

PropertyTypeDescriptionRequired
deploymentsArrayA list of deployment configurations. Each deployment represents a group of instances.Yes
deployments[].nameStringThe name of the deployment group (e.g., "Main Application").Yes
deployments[].instancesArrayA list of instances within the deployment group.Yes
instances[].idStringA unique identifier for the instance (e.g., "production", "staging").Yes
instances[].nameStringA descriptive name for the instance (e.g., "Production").Yes
instances[].hookUrlString (URL)The URL of the webhook to trigger the deployment.Yes
instances[].requestOptionsObjectAdditional options for the request (e.g., headers, body, HTTP method).No
requestOptions.methodStringHTTP method to use for the request (default: POST).No
requestOptions.headersObjectHeaders to include with the request (e.g., Content-Type: application/json).No
requestOptions.bodyObjectThe body payload to send with the request (used for POST, PUT, etc.).No

Example Configurations

Basic Deployment Configuration

1{
2  name: "My Application",
3    instances
4:
5  [
6    {
7      id: "prod",
8      name: "Production",
9      hookUrl: "https://example.com/webhook/deploy"
10    },
11    {
12      id: "dev",
13      name: "Development",
14      hookUrl: "https://dev.example.com/webhook/deploy"
15    }
16  ]
17}

Deployment with Advanced Options

1{
2  name: "Advanced Application",
3    instances
4:
5  [
6    {
7      id: "staging",
8      name: "Staging Environment",
9      hookUrl: "https://staging.example.com/webhook/deploy",
10      requestOptions: {
11        method: "POST",
12        headers: {
13          "Authorization": "Bearer my-secret-token",
14          "Content-Type": "application/json"
15        },
16        body: {
17          branch: "staging",
18          clearCache: true
19        }
20      }
21    }
22  ]
23}

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.
  • Debugging Errors: Use Strapi logs to debug any issues with plugin functionality.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve this plugin.


License

This plugin is licensed under the MIT License.

Install now

npm install strapi-plugin-deploy-dashboard

STATS

3 GitHub stars12 weekly downloads

Last updated

35 days ago

Strapi Version

5.0.0 and above

Author

github profile image for Marek Fodor
Marek Fodor

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.