I was reading this discussion Parameters When Promoting A build and I still cannot get KEY/VALUE pairs to work.
I carefully add KEY = ATEST and VALUE = 123 via the web gui when I do a new build
This is the pipeline:
- name: smoketest
- env | grep -v DRONE | grep -v CI | sort
and this is the output:
+ env | grep -v DRONE | grep -v CI | sort
I’m convinced this is a bug.
This is with drone server v2.12.1
I was just able to successfully test environment variables in a promoted pipeline with this config
- name: env
I set two variables,
ANOTHER_VARIABLE, both appeared in the log output from the
In the past I have forgotten to hit the “+Add” button when adding variables, any chance that could be the issue?
(Sorry for the delayed reply - had to go down other rabbit holes.)
Yeah, I’ve been caught out by missing the ‘+Add’ button in the past - definitely bad UI design. But no, that is not the problem here.
I tested with ‘promote’ and yes - it works, just as you say.
But I was trying to pass KEY/VALUE pairs in the initial build. That is the bit that doesn’t work. Surely, for this feature to be useful it should support passing these variables at build and promote.
I was able to confirm this is supported and working in our API / backend code:
@d1wilko can you please check the frontend code to see if we are passing build parameters as query parameters when invoking the API to create a new build?
Apologies for the delay in reply I have rejoined the drone team after a secondment!
I did a quick test in cloud.drone.io (which is an earlier version but it should be fine)
@reevespaul as you have noticed the key/value pairs are not being passed in the request for new builds - but they are for promotions - I’ll raise a ticket and fix this for new builds