You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyone coming from docker should immediately recognize the -e|--env
option as apeing docker's option of the same name. Unfortunately the circleci local execute option doesn't behave in quite the same way.
Instead of allowing you to say circleci local execute -e AWS_ACCESS_KEY_ID, for instance, it forces you to circleci local execute -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" etc.
My proposal here would be to just bring that feature from docker to circleci. If a variable is fully specified (-e FOO=BAR) then there's
no need to read it from the environment but if it's only specified by name
(-e FOO) then circleci can just resolve it as a variable in the
environment and error if it isn't found.
This is primarily to facilitate ease of local iteration.
FOO=BOO circleci local execute
FOO=BOO circleci local execute --job build
…
====>> echo "$FOO"
#!/bin/sh -eo pipefail
echo "$FOO"
Success!
# FOO is set in the environment but is not passed to local execute in any
# way so the echo is empty.
FOO=BOO circleci local execute -c x.yml -e FOO
…
====>> echo "$FOO"
#!/bin/sh -eo pipefail
echo "$FOO"
BOO
Success!
# FOO is specified in the environment and passed to local execute and so
# the value from the environment is used
FOO=BOO circleci local execute -c x.yml -e FOO=BAR
…
====>> echo "$FOO"
#!/bin/sh -eo pipefail
echo "$FOO"
BAR
Success!
# FOO is fully specified so despite being set in the environment the value
# passed explicitly is used
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?:
Anyone coming from docker should immediately recognize the
-e|--env
option as apeing docker's option of the same name. Unfortunately the
circleci local execute
option doesn't behave in quite the same way.Instead of allowing you to say
circleci local execute -e AWS_ACCESS_KEY_ID
, for instance, it forces you tocircleci local execute -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
etc.My proposal here would be to just bring that feature from docker to
circleci
. If a variable is fully specified (-e FOO=BAR
) then there'sno need to read it from the environment but if it's only specified by name
(
-e FOO
) thencircleci
can just resolve it as a variable in theenvironment and error if it isn't found.
This is primarily to facilitate ease of local iteration.
Provide an example:
The text was updated successfully, but these errors were encountered: