This is Suma from Buildkite support team. Thank you for reaching out to us with your question.
In order to achieve this you should actually set the flag plugins-always-clone-fresh to true as part of your agent configuration or during agent start up by passing flag --plugins-always-clone-fresh=true which will let the agent know that it needs to perform clone every time and not use local copy of the plugin.
When you set that flag that environment variable BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH will get set to true so instead of defining this environment variable in pipeline, you should either set the flag during agent startup or set it in agent configuration file.
Please let us know if you have any further questions on this.
Thanks for your answer. I’m aware of the flag you mention, but I was under the impression that the same could be achieved by setting that env variable on a step.
The documentation mentions this when it says:
" One way to try this is to add the following step to the Buildkite pipeline where you’re testing your plugin. Configuring BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH on only one step means that other plugins, which are unlikely to be changing in the meantime, won’t get unnecessarily cloned on every step invocation." (source)
Did I misinterpret it? Or may be this feature is not available anymore? I’m quite sure this was working with that env var on the step before.
Yes, you are correct that one of the option is to able to set this environment variable at step level so it does not apply for every plugin in the pipeline.
I did a test and can see following where it sees that env is set and removes previous checkout of the plugin
| --- | --- |
||# BUILDKITE_PLUGINS_ALWAYS_CLONE_FRESH is true; removing previous checkout of plugin github.com/buildkite-plugins/library-example-buildkite-plugin#v1.0.1|
||# Plugin "github.com/buildkite-plugins/library-example-buildkite-plugin" will be checked out to "/opt/homebrew/var/buildkite-agent/plugins/github-com-buildkite-plugins-library-example-buildkite-plugin-v1-0-1"|
Please can you send your build url to firstname.lastname@example.org where you saw it did not work so we can check further on this.