OW2 Consortium elastic-grid

Rev

Rev 14 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 jeje 1
package com.elasticgrid.substrates.tomcat6
2
 
3
import com.elasticgrid.substrates.AbstractSubstrate
4
import groovy.xml.MarkupBuilder
5
 
6
class Tomcat6Substrate extends AbstractSubstrate {
7
 
8
    public String getName() {
9
        return "Tomcat 6";
10
    }
11
 
12
    public void addDomainSpecificLangueFeatures(MarkupBuilder builder, ExpandoMetaClass emc) {
13
        emc.tomcat = { Map attributes, Closure cl ->
14
            serviceExec(name: 'Tomcat') {
15
                software(name: 'Tomcat', version: attributes.version, removeOnDestroy: attributes.removeOnDestroy) {
16
                    download source: "https://elastic-grid.s3.amazonaws.com/tomcat/apache-tomcat-${attributes.version}.zip",
17
                             installRoot: '${RIO_HOME}/system/external/tomcat', unarchive: true
18
                    postInstall(removeOnCompletion: attributes.removeOnDestroy) {
19
                        cl()
20
                        execute command: '/bin/chmod +x ${RIO_HOME}/system/external/tomcat/apache-tomcat-6.0.16/bin/*.sh',
21
                                nohup: false
22
                    }
23
                }
24
                execute inDirectory: 'bin', command: 'catalina.sh run'
25
                maintain 1
26
            }
27
        }
28
        emc.webapp = { Map attributes ->
29
            download source: attributes.source,
30
                     installRoot: '${RIO_HOME}/system/external/tomcat/apache-tomcat-6.0.16/webapps'
31
        }
32
    }
33
 
34
 
35
}