DefangLabs / defang

Defang CLI and sample projects. Defang is a radically simpler way for developers to develop, deploy, and debug cloud applications.
https://defang.io
MIT License
28 stars 6 forks source link

Setting config from interpolated values in compose.yaml #598

Open raphaeltm opened 1 month ago

raphaeltm commented 1 month ago

At the moment, something like this turns into an empty string:

  environment:
    KEY: ${ENV_VAR}

This is because we decided we don't want to accidentally expose a user's local env to the cloud and push any sensitive values. The result of this can be confusing (See #596), because it always gets set to an empty string by default.

But there are cases where the user may want to expose the value to Defang and push it to the cloud. Namely, in CI, the ergonomics of treating those env vars as sensitive configs would make it really easy to deploy: users could manage their config vals as GitHub secrets, expose them to the workflow and automatically have their config values set.

So the proposal here is to look for CI=true, and if it is, then expose the local env to Defang, which would set each of the corresponding config vals.

lionello commented 1 month ago

Special case for CI=1 is not great. I feel that will get abused since it's a good feature to use even locally. We should expose it in some other way. Two alternatives we talked about: