Add command to Grails build process -
i using grails-cdn-asset-pipline plugin. i've gone through installation , configuration steps on github , reach usage section says
add command build process (usually before war generation , deployment).
// if settings defined in config.groovy grails asset-cdn-push // or grails asset-cdn-push --provider=s3 --directory=my-bucket --gzip=true --storage-path=some-prefix --expires=365 --region=eu-west-1 --access-key=$my_s3_access_key --secret-key=$my_s3_secret_key
where in project put command?
is can within context of project, or need keep separate in build process , run in environment jenkins?
in _events.groovy
, tried invoke script in eventcreatewarstart
, having no luck there. (code taken this question)
eventcreatewarstart = { warname, stagingdir -> def pluginmanager = pluginmanagerholder.pluginmanager def plugin = pluginmanager.getgrailsplugin("cdn-asset-pipline") def plugindir = plugin.descriptor.file.parentfile map<string, string> env = system.getenv() final processbuilder = new processbuilder() processbuilder.directory(new file("${cdnassetpipelineplugindir}/scripts")) processbuilder.command([env['grails_home']+"/bin/grails","cdn-asset-push"]) println processbuilder.directory() process proc = processbuilder.start() proc.consumeprocessoutput(out, err) proc.waitfor() }
this link explains run-script
functionality merged grails 1.3.6. ran same problem of not knowing run automatically.
Comments
Post a Comment