Last active
December 25, 2015 11:19
-
-
Save modius/6968057 to your computer and use it in GitHub Desktop.
Setting machine specific attributes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction | |
name="setMachineAttributes" access="private" returntype="void" output="true" | |
hint="Sets machine specific variables as needed."> | |
<!--- developer/staging specific variables are overridden here ---> | |
<cfset var machineName=createObject("java", "java.net.InetAddress").localhost.getHostName()> | |
<cfswitch expression="#machinename#"> | |
<!--- modius machine ---> | |
<cfcase value="Greyhame.local,greyhame.daemon.com.au,Olorin.local,olorin.daemon.com.au"> | |
<cfset this.datasource = "myrailoapp-local" /> | |
<cfset application.dsn = "myrailoapp-local" /> | |
<!--- set up amazon SIMPLEDB resource ---> | |
<cfset application.aws = structNew() /> | |
<cfset application.aws.accessKeyId = "TOPSECRET" /> | |
<cfset application.aws.awsSecretKey = "ULTRASECRET" /> | |
<cfset application.aws.region = "sdb.ap-southeast-2.amazonaws.com" /> | |
</cfcase> | |
<cfdefaultcase> | |
<!--- cloudbees infrastructure ---> | |
<cfset this.datasource = "myrailoapp-db" /> | |
<cfset application.dsn = "myrailoapp-db" /> | |
<!--- set up amazon SIMPLEDB resource ---> | |
<cfset application.aws = structNew() /> | |
<cfset application.aws.accessKeyId = "TOPSECRET" /> | |
<cfset application.aws.awsSecretKey = "ULTRASECRET" /> | |
<cfset application.aws.region = "sdb.amazonaws.com" /> | |
</cfdefaultcase> | |
</cfswitch> | |
<!--- need your machine name? try this... | |
<cfoutput><h2>machinename: #machinename#</h2></cfoutput> | |
<cfdump var="#this#"> | |
<cfabort> ---> | |
<cfreturn /> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment