Reloading the Mach-II dashboard from ant

1 view
Skip to first unread message

Adam Ness

unread,
Nov 17, 2009, 10:48:30 PM11/17/09
to mach-ii-for...@googlegroups.com
I'm trying to build out an ant file that allows me to perform a
"refresh Application" from the ant file, so our release process
doesn't have to include manually clicking that button on every one of
our load-balanced servers.

Has anyone out there come up with an easy way of doing the refresh
application action from an ant build with the current Mach-II
Dashboard? I tried "<get
src="http://hostname/index.cfm?event=dashboard:config.reloadApp&amp;password=${mach-ii.password}"
dest="foo.txt" />", but foo.txt contains the login screen
afterwards... Not quite what I was hoping for.

Any thoughts?

Peter J. Farrell

unread,
Nov 17, 2009, 11:58:06 PM11/17/09
to mach-ii-for...@googlegroups.com
Yeah, that's not going to work with way we have our security schema
setup. If you're not logged in and your post a "password" from the
login screen, we perform a redirect to rid ourselves of that nasty "Are
you sure you want to re-post this form?" popup box from the browser. I
would rely on the even either in the future because we're in the middle
of AJAX-ifying the Dashboard and that will probably return some JSON
data later on.

I recommend that you file an enhancement ticket for us at
trac.mach-ii.com or I might forget about this.

I think the solution is to build out a few additional events just for
ANT and I'd probably prefix the event names with remote. The
authentication schema could differ from the normal GUI interface. Also,
I would switch to using the ANT <post> task instead because entire URLs
are stashed in web logs and it's plain text to other servers even when
using SSL (IIRC). It would better to use a simple post to get something
done like this.

In the meantime, ANT <post> handles cookies correctly! So you could do
this in the meantime you could do this:

<!-- We're posting to the default event with the "dashboard:" -->
<post to="http://www.example.com/index.cfm?event=dashboard:">
<prop name="password" value="${dashboard.password}" />
</post>
<post
to="http://www.example.com/index.cfm?event=dashboard:config.reloadApp">
</post>

FYI, reloading the app via the dashboard doesn't clear the template
cache in your CFML engine.

Best,
.Peter

Adam Ness said the following on 11/17/2009 09:48 PM:

Adam Ness

unread,
Nov 18, 2009, 3:08:37 AM11/18/09
to mach-ii-for...@googlegroups.com
Ticket created... Thanks for the suggestion about the post action
though, I'll use that for the time being.
> --
> You received this message because you are subscribed to Mach-II for CFML list.
> To post to this group, send email to mach-ii-for...@googlegroups.com
> To unsubscribe from this group, send email to mach-ii-for-coldf...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
> SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
> Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/

Mike Fransblow

unread,
Nov 18, 2009, 11:55:16 AM11/18/09
to mach-ii-for...@googlegroups.com
Just as a follow up this is something we've wrestled with as well.
It becomes even more complicated when you have multiple instances on multiple servers in a cluster - each one needs to be re-inited during a deployment.
Our solution is to bounce each service from ant when deploying. A little heavy handed but we haven't found a better way to do it yet.

If you need a really simple ant solution to accomplish this in a windoze environment, define a macro:

    <macrodef name="service">
        <attribute name="server"/>
        <attribute name="service"/>
        <attribute name="action"/>
        <sequential>
            <exec executable="sc.exe">
                 <arg value="\\@{server}"/>
                 <arg value="@{action}"/>
                 <arg value="@{service}"/>
            </exec>
     </sequential>
    </macrodef>

Then you can call this from other targets:

<target name="foo">
  <service server="{your machine name here}" action="stop" service="{your jrun service name here}"/>
  ...deploy operations etc.
  <service server="{your machine name here}" action="start" service="{your jrun service name here}"/>
</target>

cheers,

Mike F
Reply all
Reply to author
Forward
0 new messages