FlexDeploy Plugin SDK
FlexDeploy provides dozens of out of the box plugins for building and deploying software using various technologies and middleware platforms. The FlexDeploy Plugin SDK allows customers or Flexagon partners to develop their own plugins. This guide provides the documentation for creating and managing these plugin implementations.
FlexDeploy plugins are implemented in Java or Docker image and are installed on the FlexDeploy server for use within workflows. These plugins are automatically distributed to the endpoints where they are defined to execute. A plugin consists of four components:
Implementation
Java (See Plugin SDK API documentation) or
Docker image
Metadata describing its operations, properties, and other behavior
Setup scripts (optional) to initialize the environment prior to execution
Required FlexDeploy libraries for Java implementation (Java 8+ or Java 7)
See detailed instructions below.
- 1 Development Approach
- 2 Plugin Implementation
- 2.1 Java Plugin
- 2.1.1 Plugin Lifecycle
- 2.1.2 Workflow Execution Context
- 2.1.3 Logging
- 2.2 Docker image plugin
- 2.1 Java Plugin
- 3 Plugin Metadata
- 4 Plugin Setup Scripts
- 5 Plugin Unit Testing
- 6 Packaging a Plugin Version for Delivery
- 7 Java Plugin Reference Example
- 8 Installing Plugin on FlexDeploy
- 9 Best Practices
- 10 Limitations
Development Approach
Decide on implementation type - Java or Docker, depending on your expertise.
Define plugin.xml and properties.xml files. This should help you describe operations that will be developed and project or environment/instance level properties used by each operation. You can also define plugin operation inputs as appropriate. At times, you can just use inputs without properties if it makes sense.
Developer plugin implementation.
Unit test plugin operations.
Package and verify on FlexDeploy server.
Plugin Implementation
Java Plugin
Plugin Lifecycle
Each plugin operation (e.g. build, deploy, start, stop) is implemented by extending AbstractPluginProvider.
Apache HTTP Server - AbstractPluginProvider implementation - build operation
public class Build
extends AbstractPluginProvider
{
private static final String CLZ_NAM = Build.class.getName();
private static final FlexLogger LOG = FlexLogger.getLogger(CLZ_NAM);
public Build()
{
super();
}
@Override
public void validate()
throws FlexCheckedException
{
//TODO
}
@Override
public PluginResult execute()
throws FlexCheckedException
{
//TODO
}
@Override
public void cleanup()
{
//TODO
}
}
Using the XML metadata which is packaged wi