In my opinion, the presence of different outputs to the environment is a serious drawback, since this means that you need to create N copies of the application, execute the same build commands N times, etc. It is too easy to run into errors when you gave the "dev" version for the QA site, etc.
There is a little third option, between which I am a fan - storing configuration values ββon the servers themselves, separate from the application, and the application is then either written to know where to find these configuration files, or you have a kind of script that "reconfigures" the application, replacing tokens in configuration files with canonical values ββfrom external files.
Thus, you can send the same binary file for all environments, and external configurations can easily be placed under source control (for example, one file for each environment) so that changes can be checked, changes can be automatically propagated, etc. .
This is also a convenient option if you work in a large organization where developers are separated from the group that βmanagesβ the application or is responsible for different environments - because with this method developers can know what to configure, but another group is responsible for what configuration values ββfor each host.
source share