An example of Digdag plugin
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
sample
src/main
.gitignore
LICENSE
README.md
build.gradle
gradlew
gradlew.bat

README.md

digdag-plugin-example

Jitpack Digdag

1) build

./gradlew publish

Artifacts are build on local repos: ./build/repo.

2) run an example

digdag selfupdate

digdag run --project sample plugin.dig -p repos=`pwd`/build/repo

You'll find the result of the task in ./sample/example.out.


Writing your own plugin

  1. You need to implement a Plugin class that implements io.digdag.spi.Plugin.

  2. Then, list it on io.digdag.spi.Plugin. The listed plugins are loaded by Digdag.

You can optionally create Eclipse/Idea project files as follows:

gradle eclipse
gradle idea

Note: It's better to change the dependencies from provided to compile in build.gradle for creating idea/eclipse project config.

Plugin Loading

Digdag loads pluigins from Maven repositories by configuring plugin options.

You can use a local Maven repository (local FS, Amazon S3) or any public Maven repository (Maven Central, Sonatype, Bintary, Jitpack) for the plugin artifact repository.

Publishing your plugin using Github and Jitpack

Jitpack is useful for publishing your github repository as a maven repository.

git tag v0.1.3
git push origin v0.1.3

https://jitpack.io/#myui/digdag-plugin-example/v0.1.3

Now, you can load the artifact from a github repository in a dig file as follows:

_export:
  plugin:
    repositories:
      # - file://${repos}
      - https://jitpack.io
    dependencies:
      # - io.digdag.plugin:digdag-plugin-example:0.1.3
      - com.github.myui:digdag-plugin-example:v0.1.3

Further reading