Quantcast

Incremental Deployment

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Incremental Deployment

Diego Cavalcanti-3
Hello,

Can I make incremental deployment of a grails system in a tomcat server?

For example, after I deploy an application to a tomcat server, I realized that the DataSource config was wrong. Can I fix it and deploy only the DataSource.class file?

Thanks,
--
Diego
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

Burt Beckwith-2
You can, but in general it's a bad idea. The war file may be large but it can't take that long to upload.

If you do replace individual files, watch out for Closure-generated classes. Closures are implemented internally as inner classes, so for example the DataSource.groovy for a project I'm working on compiles to:

DataSource.class
DataSource$_run_closure1.class
DataSource$_run_closure2.class
DataSource$_run_closure3.class
DataSource$_run_closure3_closure4.class
DataSource$_run_closure3_closure4_closure7.class
DataSource$_run_closure3_closure5.class
DataSource$_run_closure3_closure5_closure8.class
DataSource$_run_closure3_closure6.class
DataSource$_run_closure3_closure6_closure9.class

so you need to make sure to replace every class, not just DataSource.class.

Burt

On Tue, Nov 30, 2010 at 9:40 PM, Diego Cavalcanti <[hidden email]> wrote:
Hello,

Can I make incremental deployment of a grails system in a tomcat server?

For example, after I deploy an application to a tomcat server, I realized that the DataSource config was wrong. Can I fix it and deploy only the DataSource.class file?

Thanks,
--
Diego

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

Ian Roberts
In reply to this post by Diego Cavalcanti-3
On 01/12/2010 02:40, Diego Cavalcanti wrote:
> Hello,
>
> Can I make incremental deployment of a grails system in a tomcat server?
>
> For example, after I deploy an application to a tomcat server, I
> realized that the DataSource config was wrong. Can I fix it and deploy
> only the DataSource.class file?

When working over a slow connection to a distant deployment server the
approach I usually adopt is to unpack the new version of the WAR on my
local machine and then use rsync to copy the changes to the server.

mkdir myapp-unpacked
cd myapp-unpacked
unzip /path/to/myapp.war
rsync -avP --delete * user@server:/path/to/tomcat/webapps/myapp/

(the trailing slash on the target path is significant, make sure you say
"webapps/myapp/" rather than "webapps/myapp").  That way I only have to
transfer the changes (i.e. not re-copy all the .jar files) but I still
know that the copy on the server will accurately reflect the contents of
the new WAR.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

johnrellis
In the future you could try external configs :

http://johnrellis.blogspot.com/2010/11/grails-quick-tip-external-configs.html

On Wed, Dec 1, 2010 at 9:38 AM, Ian Roberts <[hidden email]> wrote:
On 01/12/2010 02:40, Diego Cavalcanti wrote:
> Hello,
>
> Can I make incremental deployment of a grails system in a tomcat server?
>
> For example, after I deploy an application to a tomcat server, I
> realized that the DataSource config was wrong. Can I fix it and deploy
> only the DataSource.class file?

When working over a slow connection to a distant deployment server the
approach I usually adopt is to unpack the new version of the WAR on my
local machine and then use rsync to copy the changes to the server.

mkdir myapp-unpacked
cd myapp-unpacked
unzip /path/to/myapp.war
rsync -avP --delete * user@server:/path/to/tomcat/webapps/myapp/

(the trailing slash on the target path is significant, make sure you say
"webapps/myapp/" rather than "webapps/myapp").  That way I only have to
transfer the changes (i.e. not re-copy all the .jar files) but I still
know that the copy on the server will accurately reflect the contents of
the new WAR.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
John Rellis
@johnrellis

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Incremental Deployment

swamy
In reply to this post by Ian Roberts
Is there any problem if we rebuild war file and replace the existing war
file?

Thanks,
Swamy

-----Original Message-----
From: Ian Roberts [mailto:[hidden email]]
Sent: Wednesday, December 01, 2010 3:08 PM
To: [hidden email]
Subject: Re: [grails-user] Incremental Deployment

On 01/12/2010 02:40, Diego Cavalcanti wrote:
> Hello,
>
> Can I make incremental deployment of a grails system in a tomcat server?
>
> For example, after I deploy an application to a tomcat server, I
> realized that the DataSource config was wrong. Can I fix it and deploy
> only the DataSource.class file?

When working over a slow connection to a distant deployment server the
approach I usually adopt is to unpack the new version of the WAR on my
local machine and then use rsync to copy the changes to the server.

mkdir myapp-unpacked
cd myapp-unpacked
unzip /path/to/myapp.war
rsync -avP --delete * user@server:/path/to/tomcat/webapps/myapp/

(the trailing slash on the target path is significant, make sure you say
"webapps/myapp/" rather than "webapps/myapp").  That way I only have to
transfer the changes (i.e. not re-copy all the .jar files) but I still
know that the copy on the server will accurately reflect the contents of
the new WAR.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

johnrellis
In reply to this post by Ian Roberts
Not at all!  But that takes time and sanity!

On Wed, Dec 1, 2010 at 10:15 AM, Swamy Talam <[hidden email]> wrote:
Is there any problem if we rebuild war file and replace the existing war
file?

Thanks,
Swamy

-----Original Message-----
From: Ian Roberts [mailto:[hidden email]]
Sent: Wednesday, December 01, 2010 3:08 PM
To: [hidden email]
Subject: Re: [grails-user] Incremental Deployment

On 01/12/2010 02:40, Diego Cavalcanti wrote:
> Hello,
>
> Can I make incremental deployment of a grails system in a tomcat server?
>
> For example, after I deploy an application to a tomcat server, I
> realized that the DataSource config was wrong. Can I fix it and deploy
> only the DataSource.class file?

When working over a slow connection to a distant deployment server the
approach I usually adopt is to unpack the new version of the WAR on my
local machine and then use rsync to copy the changes to the server.

mkdir myapp-unpacked
cd myapp-unpacked
unzip /path/to/myapp.war
rsync -avP --delete * user@server:/path/to/tomcat/webapps/myapp/

(the trailing slash on the target path is significant, make sure you say
"webapps/myapp/" rather than "webapps/myapp").  That way I only have to
transfer the changes (i.e. not re-copy all the .jar files) but I still
know that the copy on the server will accurately reflect the contents of
the new WAR.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
John Rellis
@johnrellis

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

John Moore
In reply to this post by Ian Roberts
Ian Roberts wrote
When working over a slow connection to a distant deployment server the
approach I usually adopt is to unpack the new version of the WAR on my
local machine and then use rsync to copy the changes to the server.
This is a really neat idea and so blindingly obvious I'm ashamed I never thought of it myself! Thanks, that will help me a lot in the future.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

Diego Cavalcanti-3
Thank you! I'll try to externalize my configs and use the Ian's approach for other files.

--
Diego Cavalcanti


On Wed, Dec 1, 2010 at 10:21, John Moore <[hidden email]> wrote:


Ian Roberts wrote:
>
>
> When working over a slow connection to a distant deployment server the
> approach I usually adopt is to unpack the new version of the WAR on my
> local machine and then use rsync to copy the changes to the server.
>
>

This is a really neat idea and so blindingly obvious I'm ashamed I never
thought of it myself! Thanks, that will help me a lot in the future.

--
View this message in context: http://grails.1312388.n4.nabble.com/Incremental-Deployment-tp3066617p3067240.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental Deployment

fatzopilot
Hi,

for incremental war uploads, I made very good experiences with xdelta3, which is a binary diff tool. There are at least version for Linux and Windows. Depending on the changes between the two wars, my diff file is usually below 10% of the original war size.
E.g. on my windows development machine I use
xdelta3 -e -f -s myWar-0.9_reference.war myWar-0.9.8.9.6.7.war delta.bin
then upload the delta.bin file (about 3-4 MB) to the linux production server and invoke
xdelta3 -d -s myWar-0.9_reference.war delta.bin myWar-0.9.8.9.6.7.war
et voilá.
The myWar-0.9_reference.war must be present on both systems. Building and applying the delta is extremely fast, often < 1 s on my system.

Cheers
fatzopilot
Loading...