Create Your Plugin
Last updated
Was this helpful?
Last updated
Was this helpful?
You can create CI/CD plugins using APIs. It can be any of the following: CI plugin or CD plugin.
Your plugin can be a single-step or multi-step plugin, where steps can be considered as tasks. The task can either be simple shell commands or it can be complex operations that require a specific container environment.
In the following example, we are creating a single-step plugin named Secret Management Validator. Moreover, we want to execute a simple shell script; therefore, we are keeping the task type as SHELL
Required fields to edit in the above sample payload are:
name
Plugin name
description
Plugin description
tags
Array of tags
icon
Plugin icon url
Plugin steps
Array of tasks to execute (Details of fields discussed below)
Fields of a plugin steps are:
name
Step name
description
Description of step
index
Sequence at which the step needs to executed
outputDirectoryPath
Artifact output path
pluginStepVariable
Array of required input / output variables
pluginPipelineScript.script
Stringified bash script
Your new plugin will appear under Shared Plugins depending on which stage you have created it for: pre/post build (pluginStage = CI
), pre/post deployment (pluginStage = CD
), or both (pluginStage = CI_CD
)
The variables defined in the pluginStepVariable
array would appear as shown below.
To fetch details of a specific plugin by its ID
To fetch details of all plugins
To fetch list of all global variables
Refer the for detailed definition of each field present in the request/response body of the API.