Open raphaeltm opened 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:
-e
and --env
options (like docker
but absent from docker compose
) to explicitly expose dev env vars to Defang. This is not exactly what folks would expect though, since we'd want to use config and not simply interpolate the env vars in the compose file.defang config
to make it explicit that config(s) are being set from dev env vars.
At the moment, something like this turns into an empty string:
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.