bmuschko / gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Apache License 2.0
258 stars 61 forks source link

Support for exploded WAR deployment? #115

Closed hrstoyanov closed 9 years ago

hrstoyanov commented 9 years ago

According to the CARGO docs, WildFly 8 exploded war deployment (e.g. unpackaged WAR directory) is supported: http://cargo.codehaus.org/WildFly+8.x See "Static deployment of expanded WAR". This is very valuable and efficient feature during development. How can this be done with this plug-in? Reading the docs, it seems the deployable closure has an attribute 'file' that can only point to an archive file WAR or ERA and not a folder?

Here is my configuration: ... cargo { containerId = 'wildfly8x' remote { hostname = 'localhost' username = 'admin' password = 'admin' } local { //jvmArgs = '-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n' homeDir = file("${wildfly_root}") } deployable { file = tasks.warTemplate.destinationDir //file = tasks.draftWar.archivePath context = '/draft' } }

Here is what happens: .... Executing task ':stocks4grab:s4g-web:cargoRedeployRemote' (up-to-date check took 0.011 secs) due to: Task.upToDateWhen is false. Container ID = wildfly8x Deployable artifacts = [/home/hristo/projects/peruncs/stocks4grab/stocks4grab/s4g-web/war] Starting action 'redeploy' for remote container 'WildFly 8.x' on 'http://localhost:8080' Container properties = [:] Unknown deployable type: :stocks4grab:s4g-web:cargoRedeployRemote FAILED :stocks4grab:s4g-web:cargoRedeployRemote (Thread[main,5,main]) completed. Took 0.399 secs.

Thanks.

bmuschko commented 9 years ago

Currently, it is not supported. I'd need to see an example of one of their other plugin (Ant, Maven) on how they configure it to do this. Also feel free to provide a pull request for this.

hrstoyanov commented 9 years ago

Benjamin, From the examples here: http://cargo.codehaus.org/Static+deployment+of+expanded+WAR

JAVA:

InstalledLocalContainer container = new Resin3xInstalledLocalContainer( new Resin3xStandaloneConfiguration("target/resin3x")); container.setHome("c:/apps/resin-3.0.27");

Deployable war = new WAR("some/expanded/war/directory"); war.setContext("application-context"); container.getConfiguration().addDeployable(war);

container.start();

ANT:

note how they point to an exploded WAR directory and not a WAR archive file.

bmuschko commented 9 years ago

Doesn't look that hard. I won't get to it in the next couple of weeks. So if you want this feature soon, you'll need to provide it as pull request.

jechlin commented 9 years ago

Hi Benjamin. Thanks for this great plugin. Just wanted to add my support to this request, in my case pointing tomcat to an exploded war file.

bmuschko commented 9 years ago

@jechlin I am not sure if that's supported for Tomcat with Cargo. Something to try out. OK, guys...I am waiting for the pull request. :-)

jechlin commented 9 years ago

@bmuschko I don't know much about cargo to be honest, although http://cargo.codehaus.org/Static+deployment+of+expanded+WAR indicates it's possible I think... I would love to have a go at making the changes. When I get time I'll have a punt, but no idea when that will be.

jianliao commented 9 years ago

Hi @bmuschko, A pull request - https://github.com/bmuschko/gradle-cargo-plugin/pull/120 for this feature had been sent. Could you please review?

bmuschko commented 9 years ago

@jianliao Did you see my comment on your pull request?

hrstoyanov commented 9 years ago

This is such an important issue ...4 months now. I see if I can help tonite.

/Hristo Stoyanov On Mar 24, 2015 9:51 AM, "Benjamin Muschko" notifications@github.com wrote:

@jianliao https://github.com/jianliao Did you see my comment on your pull request?

— Reply to this email directly or view it on GitHub https://github.com/bmuschko/gradle-cargo-plugin/issues/115#issuecomment-85595253 .