Use environment substitution in routing labels

Hello, is it possible to use environment substitution in routing labels as follow (.drone.yml excerpt)?

  myprocject: ${DRONE_BRANCH}

no, it is not possible to use substitution in the node section. substitution occurs on the runner, after the pipeline has already been routed.

1 Like

Thank you, I would have expect that…

Now, I’m wondering how I can achieve a runner to be reached so that he can make deployment tasks to the web application instance (prod, dev or staging) he is attached to (~ same stack) to make that deployment based on the branch being pushed?

I would need to make a pipeline for each instance using triggers to execute the corresponding pipeline right? Or perhaps I might able to reduce instructions duplication using the Starlark scripting; need to study this…

In general, this is not an approach we recommend. Instead, we recommend separating your pipeline infrastructure from your application infrastructure. Then, from your pipeline, use something like ssh to connect and deploy to your application instances. Ideally, you treat Drone like a big pool of resources that can be used to execute any pipeline.