# Parameters When Promoting Build

**URL:** <https://drone.discourse.group/t/parameters-when-promoting-build/10813>\
**Category:** Drone Support\
**Created:** [February 2, 2021, 3:03pm UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813 "2021-02-02T15:03:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ds-amo](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ds-amo/32/2891_2.png) [@ds-amo](https://drone.discourse.group/u/ds-amo)\
**Post date:** [February 2, 2021, 3:03pm UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813/1 "2021-02-02T15:03:03Z")

</div>

Hi,

I’m promoting a build to a different environment that triggers a new pipeline (inside the same .drone.yaml file). I’m specifying a key and value in the parameter but can’t access them during the deployment.

I was under the impression that parameters would be passed in as environment variables but when printing all env vars as one of the commands it doesn’t show. Is my understanding correct or is this not how parameters work?

Thanks

---

<div class="post-metadata">

**Author:** ![ds-amo](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ds-amo/32/2891_2.png) [@ds-amo](https://drone.discourse.group/u/ds-amo)\
**Post date:** [February 3, 2021, 11:02am UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813/2 "2021-02-03T11:02:03Z")

</div>

Can anybody help?

I click promote \> enter environment \> enter parameter i.e. key=env value=prod \> click submit

Running `env` as part of the step prints out all environment variables but env=prod does not exist.

I ran a command `- echo ${env}` and it’s returned blank.

I’ve also tried adding:

```
Settings:
  env:
    from_secret: ${env}

```

and it’s still returned as blank.

---

<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:** [February 3, 2021, 2:11pm UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813/3 "2021-02-03T14:11:47Z")

</div>

> [@\[duplicate\] Lists only 100 repositories (1.0.0-rc.1)](https://drone.discourse.group/t/duplicate-lists-only-100-repositories-1-0-0-rc-1/8698/2):
>
> I click promote \> enter environment \> enter parameter i.e. key=env value=prod \> click submit
> 
> Running `env` as part of the step prints out all environment variables but env=prod does not exist.
> 
> I ran a command `- echo ${env}` and it’s returned blank.

Make sure you click the _Add_ button to add the parameter to the list. If you do not click the add button, the parameter is not registered and will not be added.

 ![Screen Shot 2021-02-03 at 9.09.24 AM](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/e/e3d569225d981bb95f02b825789965b057e34527.png)

> [@\[duplicate\] Lists only 100 repositories (1.0.0-rc.1)](https://drone.discourse.group/t/duplicate-lists-only-100-repositories-1-0-0-rc-1/8698/2):
>
> I’ve also tried adding:
> 
> ```auto
> Settings:
> env:
> from_secret: ${env}
> 
> ```
> 
> and it’s still returned as blank.

This does not work because the syntax is invalid.

The easiest way to test that environment variables are being automatically injected into your pipeline is to run the `env` command which will demonstrate the parameter was properly added, as show in this example:

```auto
kind: pipeline
type: docker
name: default

steps:
- name: test
  image: alpine
  commands:
  - env

```

---

<div class="post-metadata">

**Author:** ![ds-amo](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ds-amo/32/2891_2.png) [@ds-amo](https://drone.discourse.group/u/ds-amo)\
**Post date:** [February 3, 2021, 2:46pm UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813/4 "2021-02-03T14:46:00Z")

</div>

> [@\[duplicate\] Lists only 100 repositories (1.0.0-rc.1)](https://drone.discourse.group/t/duplicate-lists-only-100-repositories-1-0-0-rc-1/8698/3):
>
> Make sure you click the _Add_ button to add the parameter to the list. If you do not click the add button, the parameter is not registered and will not be added.

Wow…I can’t believe it was this all along! I assumed that was for adding a second parameter i.e. add another row underneath.

Thank you for your help

---

<div class="post-metadata">

**Author:** ![Daniel\_Szortyka](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/daniel_szortyka/32/2285_2.png) [@Daniel\_Szortyka](https://drone.discourse.group/u/Daniel_Szortyka)\
**Post date:** [December 21, 2021, 10:23pm UTC](https://drone.discourse.group/t/parameters-when-promoting-build/10813/5 "2021-12-21T22:23:25Z")

</div>

So, in that case, what was the solution?  
I’m trying to create key/value like APP\_STEP=CHECK but it never appears in the “env” command inside the pipeline. Can’t find more documentation than two or three links…
