1

I'm building a web application project that in my view behaves differently in specific environments. I have dev, int, uat, prod environments. DEV is a local environment for developer and 'int' is the integration environment that gets deployed on a remote machine on every commit and runs automated test cases communicating to real staging systems.

Following are differences in the environments,

  • captcha is disabled in 'int'
  • JavaScript and CSS are not minified in 'dev'.
  • HTTP headers are not cached in 'dev'. (May be I should not do this.)

Is it okay to build separately for each environment by passing the environment as argument to build job ? Or the artifact should work for any environment with only changing an external configuration file ? What is the industry conscience on this ?

2
  • 2
    What is an "artificat?" Is that some mythical pet that only lives on the Internet? Commented Apr 4, 2016 at 18:31
  • @RobertHarvey, fixed :)
    – TechCrunch
    Commented Apr 4, 2016 at 19:16

1 Answer 1

1

Many development environments have "Debug" and "Release" modes which you can use for this purpose. In those environments, they include compiler directives that allow you to, for example, remove features in debug mode.

If your environment doesn't have these provisions, I think it is better to control them with configuration files. Otherwise, you have two different builds, which means you're maintaining two different programs, not one.

2
  • Something like this jhipster.github.io/profiles is a blunder ? I forked my project from this. Looks like I have to remove all references to spring profile then ? Also, what is the advantage of spring profiles if we are using only configuration files ?
    – TechCrunch
    Commented Apr 4, 2016 at 19:20
  • If you're expecting a cut and dry answer, you're not going to get one from me. Every programming problem is a tradeoff; the Spring folks apparently decided to go a different way, and mine is just an opinion. Commented Apr 4, 2016 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.