Can we update the drone context in between so that we access that from later coming pipeline steps?

We’ve pinned some external repository’s commit ids for the tests. Before running the tests, these repositories are cloned in the preceding steps of the pipeline. We’re thinking about caching these types of pinned repositories so that we do not have to clone them for each build.

We want to store these cache with the commit id which is saved inside a file .drone.env. Inside the commands section, we can access the pinned branches inside the env file by sourcing it. But outside of the commands section, we cannot access that value, at least I’m not aware of.

If we can update the drone context ctx by some API, we can save that value in the context from the commands section and use it in the following steps from ctx.

Can we do so? Or is there any way to access such values outside of the commands section?

Thank you.

Hi @kiran welcome to the harness community :tada: let me check around and get back to you :slight_smile:


Hi @kiran didn’t get this context- “outside the commands section”

So you are using a plugin? plugins don’t have commands sections

if that is the case, you are right! it is not currently possible to pass environment variables from one step into a following plugin step

What docker images or plugins are you using in these steps?


We’d come up with some other ideas and this is not the case anymore.
btw, thank you so much for you time and effort.

1 Like