Skip to content

Commit

Permalink
Set the version of the parent kirk in the sub process
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Feb 24, 2011
1 parent 237aeae commit 87a05d1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/kirk.rb
Expand Up @@ -29,7 +29,7 @@ module Kirk
java_import "java.util.logging.ConsoleHandler" java_import "java.util.logging.ConsoleHandler"


def self.sub_process? def self.sub_process?
!!defined?(Kirk::SUB_PROCESS) !!defined?(Kirk::PARENT_VERSION)
end end


# Configure the logger # Configure the logger
Expand Down
8 changes: 8 additions & 0 deletions lib/kirk/server/application_config.rb
Expand Up @@ -44,5 +44,13 @@ def getEnvironment


map map
end end

def getKirkVersionStamper
<<-RUBY
module Kirk
PARENT_VERSION = #{VERSION.inspect}.freeze
end
RUBY
end
end end
end end
2 changes: 0 additions & 2 deletions lib/kirk/server/bootstrap.rb
@@ -1,8 +1,6 @@
require 'java' require 'java'


module Kirk module Kirk
SUB_PROCESS = true

class Server class Server
class Bootstrap class Bootstrap
def warmup(application_path) def warmup(application_path)
Expand Down
1 change: 1 addition & 0 deletions src/com/strobecorp/kirk/ApplicationConfig.java
Expand Up @@ -8,6 +8,7 @@ public interface ApplicationConfig {
public String getApplicationPath(); public String getApplicationPath();
public String getRackupPath(); public String getRackupPath();
public String getBootstrapPath(); public String getBootstrapPath();
public String getKirkVersionStamper();
public Map getEnvironment(); public Map getEnvironment();
public LifeCycle.Listener getLifeCycleListener(); public LifeCycle.Listener getLifeCycleListener();


Expand Down
1 change: 1 addition & 0 deletions src/com/strobecorp/kirk/Deploy.java
Expand Up @@ -49,6 +49,7 @@ public void terminate() {
private void initializeScriptingContext() { private void initializeScriptingContext() {
context = new ScriptingContainer(LocalContextScope.SINGLETHREAD); context = new ScriptingContainer(LocalContextScope.SINGLETHREAD);
context.setEnvironment(config.getEnvironment()); context.setEnvironment(config.getEnvironment());
context.runScriptlet(config.getKirkVersionStamper());


this.bootstrapper = context.runScriptlet( this.bootstrapper = context.runScriptlet(
PathType.ABSOLUTE, config.getBootstrapPath()); PathType.ABSOLUTE, config.getBootstrapPath());
Expand Down

0 comments on commit 87a05d1

Please sign in to comment.