Grails

Add grails scripting to allow continuous build system to perform operations on plugins like installAll, upgradeAll, cleanAll

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.2 final
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  1. _GrailsPluginsExtension.groovy
    16/Mar/10 11:37 AM
    5 kB
    Trevor Hawrysh
  2. CleanPlugins.groovy
    16/Mar/10 11:38 AM
    0.2 kB
    Trevor Hawrysh
  3. InstallPlugins.groovy
    16/Mar/10 11:37 AM
    0.2 kB
    Trevor Hawrysh
  4. UpgradePlugins.groovy
    16/Mar/10 11:37 AM
    0.2 kB
    Trevor Hawrysh

Issue Links

Activity

Hide
Trevor Hawrysh added a comment -

I created a set of targets and methods to provide some scripting ability to my Continous Build System which is Hudson.

I started with the ideas of methods in ListPluginUpdates.groovy and created a file called _GrailsPluginsExtension.groovy

My request is that the tartget and methods of _GrailsPluginsExtension.groovy should be added to _GrailsPlugins.groovy

targets provided

  • installAll (install all plugins listed in the meta data properties file, this is handled by dependcy resolution already, so not really required)
  • upgradeAll (upgrade all plugin versions listed in the meta data properties by installing the latest plugins)
  • cleanAll (deletes all installed plugins)

The methods have the ability on ONLY upgrade plugins for a specific plugin repository.

Thus, I have Hudson configured to continously upgradeAll plugins for my local grails plugin repository using the command

Usage via existing scripts due to GRAILS-5872

grails install-plugin -upgradeAll -repository=myLocalRepository -non-interactive

grails uninstall-plugin -cleanAll

You should notice that I had to overload the install-plugin target in the file _GrailsPlugins.groovy This is due to the way the GrailsScriptRunner is hard coded to NOT load plugin jars which I documented in the issue GRAILS-5872

All net new source code is attached

My current integration is done by the following changes to the _GrailsPlugins.groovy file

includeTargets << grailsScript("_GrailsPluginsExtension")


target(installPlugin:"Installs a plug-in for the given URL or name and version") {
    depends(checkVersion, parseArguments, configureProxy)
    try {
		
		if (argsMap.installAll) {
			installPlugins()
			return
		}
		
		if (argsMap.upgradeAll) {
			upgradePlugins()
			return
		}
				
		def pluginArgs = argsMap['params']
....
}

target(uninstallPlugin:"Uninstalls a plug-in for a given name") {
    depends(checkVersion, parseArguments, clean)
		
    if (argsMap.cleanAll) {
    	cleanPlugins()
    	return
    }

    if(argsMap['global']) {
        globalInstall = true
    }
...
}

Show
Trevor Hawrysh added a comment - I created a set of targets and methods to provide some scripting ability to my Continous Build System which is Hudson. I started with the ideas of methods in ListPluginUpdates.groovy and created a file called _GrailsPluginsExtension.groovy My request is that the tartget and methods of _GrailsPluginsExtension.groovy should be added to _GrailsPlugins.groovy

targets provided

  • installAll (install all plugins listed in the meta data properties file, this is handled by dependcy resolution already, so not really required)
  • upgradeAll (upgrade all plugin versions listed in the meta data properties by installing the latest plugins)
  • cleanAll (deletes all installed plugins)
The methods have the ability on ONLY upgrade plugins for a specific plugin repository. Thus, I have Hudson configured to continously upgradeAll plugins for my local grails plugin repository using the command

Usage via existing scripts due to GRAILS-5872

grails install-plugin -upgradeAll -repository=myLocalRepository -non-interactive grails uninstall-plugin -cleanAll You should notice that I had to overload the install-plugin target in the file _GrailsPlugins.groovy This is due to the way the GrailsScriptRunner is hard coded to NOT load plugin jars which I documented in the issue GRAILS-5872 All net new source code is attached My current integration is done by the following changes to the _GrailsPlugins.groovy file
includeTargets << grailsScript("_GrailsPluginsExtension")


target(installPlugin:"Installs a plug-in for the given URL or name and version") {
    depends(checkVersion, parseArguments, configureProxy)
    try {
		
		if (argsMap.installAll) {
			installPlugins()
			return
		}
		
		if (argsMap.upgradeAll) {
			upgradePlugins()
			return
		}
				
		def pluginArgs = argsMap['params']
....
}

target(uninstallPlugin:"Uninstalls a plug-in for a given name") {
    depends(checkVersion, parseArguments, clean)
		
    if (argsMap.cleanAll) {
    	cleanPlugins()
    	return
    }

    if(argsMap['global']) {
        globalInstall = true
    }
...
}

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Last Reviewed: