Programmable deploying HOWTO

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Programmable deploying HOWTO

Pavel Janousek
Hello,

is there any useful guide or some more specific docs for programmable deploying of some EAR/JAR etc.? I've understood which options I have for to do this. I prefer a way via ModelControllerClient => the same way as CLI works.

I think I've grasped what and how CLI works and does deploy/undeploy some - let say WAR artifact (= WebApp for ex.) and I can extract code technique from it. But if there is more elegant and better way which depends only on a small number of AS7 artifacts, it will be great.

I need this because I'll develop some performance tests for RESTEasy sub-system, including WebApp deploying time etc.

I think, the second reasonable way (with comparable overhead as previous) to do thing like this is use the HTTP deploying management, but I didn't found any docs about this.

Could you please point me out to some useful info or example for study?

Thank you,

--
Pavel Janousek
Senior JBoss QA Engineer


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Programmable deploying HOWTO

Brian Stansberry
You should only need the org.jboss.as:jboss-as-model-controller-client
module and its dependencies.

For examples of working with a standalone server, search for uses in the
AS codebase of
org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder,
e.g. this one that Arquillian uses for deploying test artifacts:

https://github.com/jbossas/jboss-as/blob/master/arquillian/common/src/main/java/org/jboss/as/arquillian/container/ArchiveDeployer.java

org.jboss.as.controller.client.helpers.domain.DeploymentPlanBuilder is
an equivalent class for working with a domain; search for uses of it for
examples.

On 10/24/11 8:47 AM, Pavel Janousek wrote:

> Hello,
>
> is there any useful guide or some more specific docs for programmable deploying of some EAR/JAR etc.? I've understood which options I have for to do this. I prefer a way via ModelControllerClient =>  the same way as CLI works.
>
> I think I've grasped what and how CLI works and does deploy/undeploy some - let say WAR artifact (= WebApp for ex.) and I can extract code technique from it. But if there is more elegant and better way which depends only on a small number of AS7 artifacts, it will be great.
>
> I need this because I'll develop some performance tests for RESTEasy sub-system, including WebApp deploying time etc.
>
> I think, the second reasonable way (with comparable overhead as previous) to do thing like this is use the HTTP deploying management, but I didn't found any docs about this.
>
> Could you please point me out to some useful info or example for study?
>
> Thank you,
>
> --
> Pavel Janousek
> Senior JBoss QA Engineer
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


--
Brian Stansberry
Principal Software Engineer
JBoss by Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Programmable deploying HOWTO

Dominik Pospisil
In reply to this post by Pavel Janousek

Really quick example:

 

File deployment = new File("pathToYourDeployment");

 

ModelNode addDeploymentOp = createOpNode("deployment=deployment.war", "add");

addDeploymentOp.get("content").get(0).get("input-stream-index").set(0);

DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();

builder.setOperationName("deploy");

builder.addNode("deployment", "deployment.war");

 

ModelNode[] steps = new ModelNode[2];

steps[0] = addDeploymentOp;

steps[1] = builder.buildRequest();

 

 

ModelNode compositeOp = new ModelNode();

compositeOp.get("operation").set("composite");

for(ModelNode step : steps) {

compositeOp.get("steps").add(step);

}

OperationBuilder ob = new OperationBuilder(compositeOp);

ob.addInputStream(new FileInputStream(deployment));

modelControllerClient.execute(ob.build());

 

 

- Dominik

 

 

 

 

On Monday, October 24, 2011 09:47:29 Pavel Janousek wrote:

> Hello,

>

> is there any useful guide or some more specific docs for programmable

> deploying of some EAR/JAR etc.? I've understood which options I have for to

> do this. I prefer a way via ModelControllerClient => the same way as CLI

> works.

>

> I think I've grasped what and how CLI works and does deploy/undeploy some -

> let say WAR artifact (= WebApp for ex.) and I can extract code technique

> from it. But if there is more elegant and better way which depends only on

> a small number of AS7 artifacts, it will be great.

>

> I need this because I'll develop some performance tests for RESTEasy

> sub-system, including WebApp deploying time etc.

>

> I think, the second reasonable way (with comparable overhead as previous) to

> do thing like this is use the HTTP deploying management, but I didn't found

> any docs about this.

>

> Could you please point me out to some useful info or example for study?

>

> Thank you,

>

> --

> Pavel Janousek

> Senior JBoss QA Engineer

>

>

> _______________________________________________

> jboss-as7-dev mailing list

> [hidden email]

> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev