Build and Publish a Plugin
Use the included Gradle task to build the plugin. Then, you can publish it to Maven Central.
Build a plugin
To build your plugin, execute the ./gradlew shadowJar
command from the plugin directory.
The resulting JAR file will be generated in the build/libs
directory.
To use this plugin in your Kestra instance, add this JAR to the Kestra plugins path.
Use a custom docker image with your plugin
Adding this Dockerfile
to the root of your plugin project:
FROM kestra/kestra:develop
COPY build/libs/* /app/plugins/
You can build and run the image with the following command assuming you're in the root directory of your plugin:
./gradlew shadowJar && docker build -t kestra-custom . && docker run --rm -p 8080:8080 kestra-custom server local
You can now navigate to http://localhost:8080 and start using your custom plugin. Feel free to adapt the Dockerfile to your needs (eg. if you plan to use multiple custom plugins, include all builds directory in it).
Publish a plugin
Here is how you can publish your plugin to Maven Central.
GitHub Actions
The plugin template includes a GitHub Actions workflow to test and publish your plugin. You can extend it by adding any additional testing or deployment steps.
Publish to Maven Central
The template includes a Gradle task that will publish the plugin to Maven Central. You need a Maven Central account in order to publish your plugin.
You only need to configure the gradle.properties
to have all required properties:
sonatypeUsername=
sonatypePassword=
signing.keyId=
signing.password=
signing.secretKeyRingFile=
There is a pre-configured GitHub Actions workflow in the .github/workflows/main.yml
file that you can customize to your need:
Was this page helpful?