Skip to content

Commit

Permalink
Support mysql/oracle by using non-reserved words
Browse files Browse the repository at this point in the history
Set table/field names to non-reserved words for some domain
classes if the rundeck.v14.rdbsupport config value is "true"

set the value to true by default

(merge 5e51362 from development)
  • Loading branch information
gschueler committed Sep 20, 2011
1 parent 9df821d commit 92819b0
Show file tree
Hide file tree
Showing 9 changed files with 217 additions and 173 deletions.
3 changes: 3 additions & 0 deletions packaging/debroot/etc/rundeck/rundeck-config.properties
Expand Up @@ -9,6 +9,9 @@ reportservice.log4j.port=4435
dataSource.dbCreate = update
dataSource.url = jdbc:hsqldb:file:/var/lib/rundeck/data/grailsdb;shutdown=true

#note, make sure this is set to "true" if you are using Oracle or Mysql
rundeck.v14.rdbsupport=true

#
#Map rundeck actions to allowed roles
# mappedRoles.X=A,B,C
Expand Down
3 changes: 3 additions & 0 deletions packaging/root/etc/rundeck/rundeck-config.properties
Expand Up @@ -9,6 +9,9 @@ reportservice.log4j.port=4435
dataSource.dbCreate = update
dataSource.url = jdbc:hsqldb:file:/var/lib/rundeck/data/grailsdb;shutdown=true

#note, make sure this is set to "true" if you are using Oracle or Mysql
rundeck.v14.rdbsupport=true

#
#Map rundeck actions to allowed roles
# mappedRoles.X=A,B,C
Expand Down
Expand Up @@ -29,4 +29,6 @@ mappedRoles.resources_create=admin,api_token_group
mappedRoles.resources_update=admin,api_token_group
mappedRoles.resources_delete=admin,api_token_group
#special role for viewing jobs unauthorized to run
mappedRoles.job_view_unauthorized=job_view_unauthorized,api_token_group
mappedRoles.job_view_unauthorized=job_view_unauthorized,api_token_group
#note, make sure this is set to "true" if you are using Oracle or Mysql
rundeck.v14.rdbsupport=true
4 changes: 4 additions & 0 deletions rundeckapp/grails-app/conf/Config.groovy
Expand Up @@ -51,6 +51,10 @@ environments {
}
development{
grails.serverURL="http://localhost:9090/rundeck"
rundeck.v14.rdbsupport = "true"
}
test {
rundeck.v14.rdbsupport = "true"
}
}

Expand Down
8 changes: 7 additions & 1 deletion rundeckapp/grails-app/domain/ExecutionContext.groovy
@@ -1,4 +1,4 @@

import org.codehaus.groovy.grails.commons.ConfigurationHolder
/**
* ExecutionContext
*/
Expand All @@ -9,6 +9,12 @@ abstract class ExecutionContext extends BaseNodeFilters{
Workflow workflow
String loglevel="WARN"

static mapping = {
def config = ConfigurationHolder.config
if (config.rundeck.v14.rdbsupport == 'true') {
user column: "rduser"
}
}
Boolean nodeKeepgoing=false
Boolean doNodedispatch=false
Integer nodeThreadcount=1
Expand Down
10 changes: 9 additions & 1 deletion rundeckapp/grails-app/domain/Option.groovy
@@ -1,3 +1,5 @@
import org.codehaus.groovy.grails.commons.ConfigurationHolder

/*
* Copyright 2010 DTO Labs, Inc. (http://dtolabs.com)
*
Expand All @@ -12,7 +14,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/
/*
* Option domain class, stores the definition of allowable user inputs for a
* CLI option for a WOrkflow Job (ScheduledExecution)
Expand Down Expand Up @@ -64,6 +66,12 @@ public class Option implements Comparable{
multivalued(nullable:true)
}

static mapping = {
def config = ConfigurationHolder.config
if (config.rundeck.v14.rdbsupport=='true') {
table "rdoption"
}
}
/**
* Return canonical map representation
*/
Expand Down
9 changes: 8 additions & 1 deletion rundeckapp/grails-app/domain/ScheduledExecution.groovy
@@ -1,3 +1,5 @@
import org.codehaus.groovy.grails.commons.ConfigurationHolder

class ScheduledExecution extends ExecutionContext {
SortedSet options
static hasMany = [executions:Execution,options:Option,notifications:Notification]
Expand Down Expand Up @@ -69,7 +71,12 @@ class ScheduledExecution extends ExecutionContext {
adhocFilepath(nullable:true, blank:true)
uuid(unique: true, nullable:true, blank:false)
}

static mapping = {
def config = ConfigurationHolder.config
if (config.rundeck.v14.rdbsupport == 'true') {
user column: "rduser"
}
}
public static final daysofweeklist = ['SUN','MON','TUE','WED','THU','FRI','SAT'];
public static final monthsofyearlist = ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'];

Expand Down
8 changes: 8 additions & 0 deletions rundeckapp/grails-app/domain/User.groovy
@@ -1,3 +1,5 @@
import org.codehaus.groovy.grails.commons.ConfigurationHolder

class User {
String login
String password
Expand All @@ -7,6 +9,12 @@ class User {
Date dateCreated
Date lastUpdated

static mapping = {
def config = ConfigurationHolder.config
if (config.rundeck.v14.rdbsupport == 'true') {
table "rduser"
}
}
String dashboardPref
String filterPref
static hasMany = [reportfilters:ReportFilter,jobfilters:ScheduledExecutionFilter,nodefilters:NodeFilter]
Expand Down

0 comments on commit 92819b0

Please sign in to comment.