Create Your Plugin
Last updated
Was this helpful?
Last updated
Was this helpful?
Devtron lets you create plugins to run specific tasks at different stages of your CI/CD pipelines. You can create any of the following:
CI plugin (in pre-build/post-build stage)
CD plugin (in pre-deployment/post-deployment stage) ...or both.
You can achieve this by converting a fully functional custom task into a plugin. Creating a plugin makes it reusable with other CI or CD pipelines.
There are two parts to creating a plugin:
In the following example, we are creating a plugin named 'Secret Management Validator'.
Go to Applications and select your app from the Devtron Apps tab.
From the Configurations tab, go to Workflow Editor.
Click any pipeline (build/deployment pipeline).
Go to the Pre or Post stage of your pipeline, e.g., Pre-build stage
.
Click + Add Task to create a plugin from scratch or click an existing task.
On the Execute Custom Task page, fill the following details:
Task Name - Give a name to the task, e.g., Secret Management Validator Task
.
Description - Write the purpose of the task in brief.
Input Variables - Add one or more input variables to accept values from the user. Give a name to your input variable along with a description and input type (String/Number/Boolean/Date).
Trigger Skip Condition - Here you can set conditions to execute or skip the task. You can select Set trigger conditions to execute the task, or Set skip conditions to skip the task.
Script - Enter the script to be executed.
Output directory path - Enter the directory where your script will write/produce output files (e.g., test report, zip files).
Output Variables - Similar to input variables, you can create variables whose values will be generated as output after task execution.
Click Update Pipeline.
Go to your custom task that you have tried and tested, and click Save as Plugin.
In the New plugin tab, fill the following details:
Plugin Icon
Enter the online URL of your plugin icon (jpg/png supported). This image will be shown alongside your plugin name in the list of plugins.
Plugin display name
Enter the name of your plugin, e.g., Secret Management Validator
Plugin ID
Enter a unique identifier for your plugin, e.g., sec-mgmt-val
Plugin version
Enter the version of your plugin. We recommend using semantic versioning, e.g., 1.0.0
Documentation link
Give the user guide link for this plugin, e.g., https://docs.devtron.ai/usage/plugins/plugin-list/jira-validator
Description
Enter a brief description of your plugin explaining what the plugin does
Tags
Select one or more tags from the list or create your own tag. This tag helps in identifying and classifying the plugin, e.g., Compliance
Secrets
Security
.
You have the option of marking the input variables (defined in step 6 earlier) as mandatory/optional. Enabling the toggle will make the input variable mandatory for your users.
Since you created the plugin from a custom task, you get an option to replace the original task with your plugin (in the task list).
Click Create Plugin Version.
Your new plugin would appear in the list of plugins.
You may create incremental versions of your plugin (e.g., 1.0.0
→ 1.0.1
or 2.0.0
). The old version(s) of your plugins will still be available to your users.
From the New version of existing plugin tab, select the plugin for which you want to create a new version from the Existing Plugin dropdown.
Specify the new version in the New version field.
Verify the details in the remaining fields that got auto-populated from your existing plugin and modify if required.
Click Create Plugin Version.
You can view and use the available plugin versions as shown below.
-->
Task Type - Choose Shell
if the task consists of shell commands or choose Container Image
in case of complex operations that require a specific container environment (refer ).
Go to the Build & Deploy tab of your application and run the pipeline having your custom task. If the custom task executes correctly and the script performs as expected, you may proceed to .
Follow steps 1-7 from the section of this document.