Closed 6543 closed 11 months ago
tldr of how to do plugin is: all settings (arguments) are environment variables start with prefix PLUGIN_ most plugins use the build-in-env-vars for default values ... and as plugin you define the container entrypoint
simplest example I know of: https://github.com/vividboarder/drone-webdav
As I need to write some plugins, I am going to put together a small template bash plugin. What I plan is:
Dockerfile
(alpine based)plugin.sh
which
woodpeckerci/plugin-docker-buildx
to build the imagesI could need some help:
Question 2. somehow requires some vision on where Woodpecker will go and if we strive to be compatible with drone for the forseable future on the plugin level.
- Input on the structure / content of the Readme template. ATM I am going to structure it like this: https://github.com/smainz/woodpecker-git-setup/blob/main/Readme.md
That structure is nice. To be able to list projects in the official Woodpecker plugins list its in addition quite / even more important to provide a docs.md
file.
Example docker-buildx
:
- Should the plugin prefer DRONE* or CI* env vars?
If the plugin is mainly for Woopecker it should go with CI_
variables as they are more feature-rich. They are not as vendor specific as well.
- What are the 'best practices' mentioned above
I guess that's a list that can be extended from time to time we experience any pitfalls. Currently I can think of things like supporting both CI_
and DRONE_
in case you want to use the plugin with DRONE_
as well. We could for example also provide a https://github.com/drone-plugins/drone-plugin-lib version for Woodpecker and link it here.
- What more would you like to see?
It would be nice to suggest users to add the plugin to our index so the whole community can benefit from them.
settings explained:
settings:
some-bool: false # will be PLUGIN_SOME_BOOL="false"
some_String: hello # will be PLUGIN_SOME_STRING="hello"
anInt: 3 # will be PLUGIN_ANINT="3"
nonBasicType: # will be json in PLUGIN_NONBASICTYPE="{"abc": "2", "list": [ "2", "3" ]}"
abc: 2
list:
- 2
- 3
Should probably mention: https://codeberg.org/woodpecker-plugins/go-plugin