Try Devtron Enterprise!
Start Free Trial
LogoLogo
WebsiteDevtron demoGithub RepoJoin Discord
v0.7
v0.7
  • Introduction
  • Getting Started
  • Install Devtron
    • Install Devtron with CI/CD
    • Install Devtron with CI/CD and GitOps (Argo CD)
    • Install Devtron without Integrations
    • Install Devtron on Minikube, Microk8s, K3s, Kind, Cloud VMs
    • Install Devtron on Airgapped Environment
    • Demo on Popular Cloud Providers
    • Backup for Disaster Recovery
    • Uninstall Devtron
    • FAQs
  • Install Devtron Enterprise Trial
  • Devtron Kubernetes Client
  • Configurations
    • Installation Configurations
    • Override Configurations
    • Ingress Setup
  • Global Configurations
    • Host URL
    • GitOps
    • Projects
    • Clusters & Environments
    • Git Accounts
    • Container/OCI Registry
    • Chart Repositories
    • Deployment Charts
    • Authorization
      • SSO Login Services
        • Google
        • GitHub
        • GitLab
        • Microsoft
        • LDAP
        • OIDC
          • Keycloak
          • Okta
        • OpenShift
      • User Permissions
      • Permission Groups
      • API Tokens
    • Notifications
    • Deployment Window
    • Approval Policy
    • External Links
    • Catalog Framework
    • Scoped Variables
    • Plugin Policy
    • Pull Image Digest
    • Tags Policy
    • Filter Condition
    • Lock Deployment Configuration
    • Image Promotion Policy
    • Build Infra
  • Devtron Upgrade
    • Update Devtron from Devtron UI
    • Upgrade to 1.5.0
    • 0.6.x-0.7.x
    • 0.5.x-0.6.x
    • 0.4.x-0.5.x
    • 0.4.x-0.4.x
    • 0.3.x-0.4.x
    • 0.3.x-0.3.x
    • 0.2.x-0.3.x
  • Usage
    • Applications
      • Create a New Application
      • Clone an Existing Application
      • Deploy a Sample Application
      • App Configuration
        • Git Repository
        • Build Configuration
        • Base Deployment Template
          • Deployment
          • Rollout Deployment
          • Job and Cronjob
          • StatefulSets
        • GitOps Configuration
        • Workflow Editor
          • CI Pipeline
            • Pre-Build/Post-Build Stages
            • Override Build Configuration
          • CD Pipeline
        • ConfigMaps
        • Secrets
          • External Secret Operator (ESO)
            • AWS Secrets Manager
            • Google Secrets Manager
            • HashiCorp Vault
        • Environment Overrides
        • Deleting Application
      • Build and Deploy
        • Triggering CI
        • Triggering CD
        • Rollback Deployment
        • Applying Labels to Images
      • App Details
        • Debugging Deployment And Monitoring
        • Using Ephemeral Containers
        • Application Metrics
      • Application Overview
    • Jobs
      • Create a new job
      • Configurations
      • Workflow Editor
      • Trigger Job
      • Overview
    • Application Groups
    • Software Distribution Hub
      • Tenants
      • Release Hub
    • Resource Browser
    • Resource Watcher
    • Charts
      • Charts Overview
      • Deploy & Observe
      • Examples
        • Deploying Mysql Helm Chart
        • Deploying MongoDB Helm Chart
      • Chart Group
    • Security
      • Security Scans
      • Security Policies
    • Bulk Edit
    • Integrations
      • Build and Deploy (CI/CD)
      • GitOps (Argo CD)
      • Vulnerability Scanning (Clair)
      • Notifications
      • Monitoring (Grafana)
    • Pipeline Plugins
      • Create Your Plugin
      • Our Plugins
        • Ansible Runner
        • Bitbucket Runner Trigger
        • Codacy
        • Code-Scan
        • Copacetic
        • Container Image Exporter
        • Copy Container Image
        • Cosign
        • CraneCopy
        • Dependency track - Maven & Gradle
        • Dependency track - NodeJS
        • Dependency track - Python
        • Devtron CD Trigger
        • Devtron CI Trigger
        • Devtron Job Trigger
        • DockerSlim
        • EKS Create Cluster
        • GCS Create Bucket
        • GitHub Pull Request Updater
        • GKE Provisioner
        • GoLang-migrate
        • Jenkins
        • Jira Issue Validator
        • Jira Issue Updater
        • K6 Load Testing
        • Pull images from container repository
        • Semgrep
        • SonarQube
        • SonarQube v1.1.0
        • Terraform CLI
        • Vulnerability Scanning
  • Resources
    • Glossary
    • Troubleshooting
    • Use Cases
      • Devtron Generic Helm Chart To Run CronJob Or One Time Job
      • Connect SpringBoot with Mysql Database
      • Connect Expressjs With Mongodb Database
      • Connect Django With Mysql Database
      • Pull Helm Charts from OCI Registry
    • Telemetry Overview
    • Devtron on Graviton
    • Release Notes
Powered by GitBook
On this page
  • Introduction
  • Plugin Creation
  • Part 1: Create a Custom Task
  • Part 2: Convert Custom Task to a Plugin
  • Create a New Version of Plugin

Was this helpful?

Export as PDF
  1. Usage
  2. Pipeline Plugins

Create Your Plugin

PreviousPipeline PluginsNextOur Plugins

Last updated 8 days ago

Was this helpful?

Introduction

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.


Plugin Creation

There are two parts to creating a plugin:

Part 1: Create a Custom Task

Who Can Perform This Action?

Only superadmins can create plugins.

Prerequisite

A build or deployment pipeline must exist in the Workflow Editor of your app.

In the following example, we are creating a plugin named 'Secret Management Validator'.

  1. Go to Applications and select your app from the Devtron Apps tab.

  2. From the Configurations tab, go to Workflow Editor.

  3. Click any pipeline (build/deployment pipeline).

  4. Go to the Pre or Post stage of your pipeline, e.g., Pre-build stage.

  5. Click + Add Task to create a plugin from scratch or click an existing task.

  6. 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.

  7. Click Update Pipeline.

Next Steps


Part 2: Convert Custom Task to a Plugin

  1. Go to your custom task that you have tried and tested, and click Save as Plugin.

  2. In the New plugin tab, fill the following details:

    Fields
    Description

    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.

  3. 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.

  4. 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).

  5. Click Create Plugin Version.

  6. Your new plugin would appear in the list of plugins.


Create a New Version of Plugin

Who Can Perform This Action?

Only superadmins can create new versions of a plugin.

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.

  1. 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.

  2. Specify the new version in the New version field.

  3. Verify the details in the remaining fields that got auto-populated from your existing plugin and modify if required.

  4. Click Create Plugin Version.

  5. You can view and use the available plugin versions as shown below.

-->

Figure 1: Choosing your App
Figure 2: Workflow Editor
Figure 3: Selecting Pipeline
Figure 4: Selecting Stage
Figure 5: Adding a Task

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 ).

Figure 6: 'Execute Custom Task' Page
Figure 7: 'Update Pipeline' Button

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 .

Figure 8: 'Save as Plugin' Option
Figure 8: Entering New Plugin Details
Figure 9: Marking Variables as Mandatory or Optional
Figure 10: Replace Task with Plugin
Figure 11: 'Create Plugin Version' Button
Figure 12: List of Plugins

Follow steps 1-7 from the section of this document.

Figure 13: Selecting Existing Plugin for Versioning
Figure 14: Creating New Version
Figure 15: Selecting a Version
'Container Image' task
Create a Custom Task
Convert Custom Task to a Plugin
save your custom task as a plugin
Create a New Plugin