Hi Matt,
After a further dig into cargo-ant, I had a workaround, please see the
following ant snippet. The idea is to ask Cargo to use default type to
create a new internal TC instance, and copy the wars/context files to
the custom webapp dir. Lastly let Cargo to restart the TC created
previously with its "installed" type and treat the configuration as
exisiting.
<cargo containerId="${cargoId}" id="${cargoId}" home="${tomcat.home}"
action="start" output="${test.dir}/cargo.log" wait="false">
<configuration home="${test.dir}/${cargoId}">
<property name="cargo.logging" value="high"/>
<property name="cargo.servlet.port" value="${http.port}"/>
<property name="cargo.jvmargs"
value="${run.executive.test.debugargline}"/>
<!--<property name="cargo.servlet.users"
value="tomcat:tomcat:manager"/>-->
<!--<deployable type="war"
file="${webapp.dist}/${webapp.war}"/>-->
</configuration>
</cargo>
<!--copy the wars and context files to the custom webapps dir
after cargo create an internal tomcat instance-->
<unwar src="${webapp.dist}/${webapp.war}"
dest="${test.dir}/${cargoId}/${instance.name}-webapps/${webapp.name}"/>
<ant antfile="../common.xml" target="create-test-context">
<property name="webapp" value="${webapp.name}"/>
</ant>
<cargo refid="${cargoId}" action="stop"/>
<!--ask cargo to restart an installed TC and use existing
configuration so that cargo won't delete and recreate a TC -->
<cargo containerId="${cargoId}" id="${cargoId}" action="start"
home="${tomcat.home}" type="installed" output="${test.dir}/cargo.log"
wait="false" >
<configuration home="${test.dir}/${cargoId}" type="existing">
<property name="cargo.logging" value="high"/>
<property name="cargo.servlet.port" value="${http.port}"/>
<property name="cargo.jvmargs"
value="${run.executive.test.debugargline}"/>
</configuration>
</cargo>
<antcall target="test-canoo"/>
<cargo refid="${cargoId}" action="stop"/>
Cheers
Haotian
Matt Raible wrote:
If you package a context.xml file in your WAR's META-INF directory,
Tomcat will take care of deploying it to
$CATALINA_HOME/conf/Catalina/localhost. As far as deploying to a
custom webapps directory, I don't know if that's possible. You could
try asking on the Cargo mailing list or searching their archives. Even
though it's mailing list is not very active, I believe there's a fair
amount of folks subscribed and I know a lot of people use Cargo.
Matt
On Feb 21, 2008, at 6:55 AM, Haotian Sun wrote:
Hi Matt and all,
I have a project using Appfuse 1.9.4 as the framework, and in your
original test-jsp target in the build.xml, you have the cargo to
manage an internal tomcat instance for the webtest, which deploys the
war to tomcat's default webapps dir. But now I would like to deploy
my app to a custom webapps dir, e.g a dir in
tomcat5x/myproject-webapps. Meanwhile, I also need to deploy the
webapp context file to tomcat5x/conf/Catalina/localhost/ dir.
<cargo containerId="${cargoId}" id="${cargoId}" home="${tomcat.home}"
action="start" output="${test.dir}/cargo.log" wait="false">
<configuration home="${test.dir}/${cargoId}">
<property name="cargo.logging" value="high"/>
<property name="cargo.servlet.port"
value="${http.port}"/>
<property name="cargo.jvmargs"
value="${run.executive.test.debugargline}"/>
<deployable type="war"
file="${webapp.dist}/${webapp.war}"/>
</configuration>
</cargo>
I looked into the Cargo doc/api and don't think Cargo supports such a
custom deployment via its <deployable> tag. Do you have any
experience/idea on how to manage this? Please note we can not do, say
start cargo, copy custom webapps and context files and then stop and
restart the cargo via its action property, because cargo will
clean/rebuild the tomcat5x instance every time when calling start
action.
Cheers
Haotian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]