Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Production and Development servers

Explorer ,
Apr 20, 2009 Apr 20, 2009

Hi,

I am looking for input on how some of you may handle this situation. I have a production and a development server for the obvious reasons. But what I would like to do is have a dynamic way for the application to tell what server it is on. For instance, during development/testing there will be "fake" cases built that only the test group needs to be aware of and as an example the system will email the "fake" results to my test team so that they can see what is happening on the test side. But, once I implement and move everything to production the test rules no longer apply. As it is now, I manually make the switches in code manually between test and production scenarios. What I would like acheive is the application to just "know" what to do based on the server it is running from. I know I could write some code to look at the URL to distinguish the difference, but I dont like that idea. I would like a solution that would perform more at the system level. Any ideas?

TOPICS
Advanced techniques
935
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 29, 2009 Apr 29, 2009

application.cfc or cfm will give you the most bang for your buck.  Don't make it a local varible though.  Put it in the application or session scope

Translate
LEGEND ,
Apr 20, 2009 Apr 20, 2009

You'll have to write some if/else code on something.  server.name is a good candiate.

We took it one step further.  We have a server variable effectively called isProduction.  We use this variable in our code, in case we have to change servers for some reason.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 20, 2009 Apr 20, 2009

Sounds feasible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 29, 2009 Apr 29, 2009

I have this now and it has no problem is distinguishing who they are. Would there be any problems in putting this in the Application.cfm file or should I put it elsewhere.

<cfif #cgi.SERVER_NAME# is 'ServerSpecificCriteria'>
<cfset whoami = 'Development'>
<cfelseif #cgi.SERVER_NAME# is 'ServerSpecificCriteria'>
<cfset whoami = 'Production'>
</cfif>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 29, 2009 Apr 29, 2009

application.cfc or cfm will give you the most bang for your buck.  Don't make it a local varible though.  Put it in the application or session scope

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 29, 2009 Apr 29, 2009
LATEST

Or maybe even the "server" scope!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources