# Use environment substitution in routing labels

**URL:** <https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430>\
**Category:** Drone Support\
**Created:** [October 31, 2019, 10:34am UTC](https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430 "2019-10-31T10:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trepmag](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/trepmag/32/5716_2.png) [@trepmag](https://drone.discourse.group/u/trepmag)\
**Post date:** [October 31, 2019, 10:34am UTC](https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430/1 "2019-10-31T10:34:42Z")

</div>

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

```auto
...
node:
  myprocject: ${DRONE_BRANCH}

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 31, 2019, 4:09pm UTC](https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430/2 "2019-10-31T16:09:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![trepmag](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/trepmag/32/5716_2.png) [@trepmag](https://drone.discourse.group/u/trepmag)\
**Post date:** [October 31, 2019, 4:55pm UTC](https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430/3 "2019-10-31T16:55:32Z")

</div>

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](https://docs.drone.io/pipeline/docker/syntax/trigger/) to execute the corresponding pipeline right? Or perhaps I might able to reduce instructions duplication using the [Starlark scripting](https://docs.drone.io/starlark/overview/); need to study this…

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 31, 2019, 4:58pm UTC](https://drone.discourse.group/t/use-environment-substitution-in-routing-labels/9430/4 "2019-10-31T16:58:45Z")

</div>

> [@On another topic](https://drone.discourse.group/t/6115/3):
>
> 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

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.
