Quantcast

Inheriting development environment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Inheriting development environment

Konstantyn Smirnov
Hi all

In my project I need to link a server which is behind a firewall. If I access it from inside the DMZ it has one URL, but when I go remotely from outside, the URL changes.

The straight-forward solution would be:

environments {
    development {
      serverURL = 'from.inside.dmz'        
    }
    remote {
      serverURL = 'remote.server.url'        
    }
}

the problem is, that I have other env-specific options which I would not like to copy. Also I need a GSP-reload function available for dev-env.

For that I would like to extend the development environment and override only the URL.

What's the easiest trick to get that done?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inheriting development environment

Ian Roberts
Konstantyn Smirnov wrote:
> For that I would like to extend the development environment and override
> only the URL.
>
> What's the easiest trick to get that done?

Don't know if this works but my first approach would be to try a trick
with closures and delegates, something like:

envrionments {
  // the "def" on the next line is important...
  def commonConfig = {
    // put settings in here that are common to both envs
    my.app.something = "foo"
  }
  development {
    commonConfig.delegate = delegate
    commonConfig.call()
    serverURL = 'from.inside.dmz'
  }
  remote {
    commonConfig.delegate = delegate
    commonConfig.call()
    serverURL = 'remote.server.url'
  }
}

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inheriting development environment

Konstantyn Smirnov
that's possible indeed, but IMHO a little overcomplicated for a configuration.

Such stuff should be a part of Config-DSL

PS for now I use a
System.getenv( 'SERVER_URL' ) ?: 'fall.back.url'
Loading...