Skip to content

Instantly share code, notes, and snippets.

@willis7
Created August 8, 2013 14:23
Show Gist options
  • Save willis7/6185026 to your computer and use it in GitHub Desktop.
Save willis7/6185026 to your computer and use it in GitHub Desktop.
OSB 11g Gradle deployment scripts
environments {
local {
serverName = 'localVM'
wls {
adminurl = 't3://localhost:7001'
user = 'weblogic'
password = 'welcome1'
targets = 'AdminServer'
upload = 'true'
verbose = 'true'
debug = 'false'
}
osb{
importScript = 'import.py'
exportScript = 'export.py'
importjar = 'export/sbconfig.jar'
importCustomFile = 'plans/sbconfig_Customization.xml'
}
}
}
task deployToOSB (dependsOn: 'configEnv') << {
println "$System.env.WEBLOGIC_CLASSPATH"
ant.taskdef(name: 'wlst',
classname: 'weblogic.ant.taskdefs.management.WLSTTask',
classpath: (configurations.weblogic + configurations.osb).asPath)
ant.wlst(fileName: config.osb.importScript,
debug: true ,
failOnError: false ,
classpath: "$System.env.WEBLOGIC_CLASSPATH" + (configurations.weblogic + configurations.osb).asPath,
arguments: "$config.wls.user $config.wls.password $config.wls.adminurl $project.name $config.osb.importjar $config.osb.importCustomFile")
}
task configEnv << {
project.ext.config = new ConfigSlurper("$env").parse(new File('env.groovy').toURL())
logger.lifecycle "Environment is set to $env"
}
@willis7
Copy link
Author

willis7 commented Aug 8, 2013

$gradle deployToOSB -Penv=local

@spattanaik75
Copy link

Hi
This script is not working for me.
Could you also please mention what environment variables needs to be configured.

If you have a working example ,please do attach

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment